| 2307 | |
| 2308 | |
| 2309 | void ensureTrailingSlash(char* pDstPath, const char* pSrcPath) |
| 2310 | { |
| 2311 | // Copy to target. |
| 2312 | dStrcpy(pDstPath, pSrcPath); |
| 2313 | |
| 2314 | // Find trailing character index. |
| 2315 | S32 trailIndex = dStrlen(pDstPath); |
| 2316 | |
| 2317 | // Ignore if empty string. |
| 2318 | if (trailIndex == 0) |
| 2319 | return; |
| 2320 | |
| 2321 | // Finish if the trailing slash already exists. |
| 2322 | if (pDstPath[trailIndex - 1] == '/') |
| 2323 | return; |
| 2324 | |
| 2325 | // Add trailing slash. |
| 2326 | pDstPath[trailIndex++] = '/'; |
| 2327 | pDstPath[trailIndex] = 0; |
| 2328 | } |
| 2329 | |
| 2330 | //----------------------------------------------------------------------------- |
| 2331 |
no test coverage detected