| 2388 | |
| 2389 | |
| 2390 | void ensureTrailingSlash(char* pDstPath, const char* pSrcPath, S32 dstSize) |
| 2391 | { |
| 2392 | // Copy to target. |
| 2393 | dStrcpy(pDstPath, pSrcPath, dstSize); |
| 2394 | |
| 2395 | // Find trailing character index. |
| 2396 | S32 trailIndex = dStrlen(pDstPath); |
| 2397 | |
| 2398 | // Ignore if empty string. |
| 2399 | if (trailIndex == 0) |
| 2400 | return; |
| 2401 | |
| 2402 | // Finish if the trailing slash already exists. |
| 2403 | if (pDstPath[trailIndex - 1] == '/') |
| 2404 | return; |
| 2405 | |
| 2406 | // Add trailing slash. |
| 2407 | pDstPath[trailIndex++] = '/'; |
| 2408 | pDstPath[trailIndex] = 0; |
| 2409 | } |
| 2410 | |
| 2411 | //----------------------------------------------------------------------------- |
| 2412 |
no test coverage detected