| 2344 | } |
| 2345 | |
| 2346 | AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *src1, |
| 2347 | const char *src2) |
| 2348 | { |
| 2349 | apr_size_t len1, len2; |
| 2350 | char *path; |
| 2351 | |
| 2352 | len1 = strlen(src1); |
| 2353 | len2 = strlen(src2); |
| 2354 | /* allocate +3 for '/' delimiter, trailing NULL and overallocate |
| 2355 | * one extra byte to allow the caller to add a trailing '/' |
| 2356 | */ |
| 2357 | path = (char *)apr_palloc(a, len1 + len2 + 3); |
| 2358 | if (len1 == 0) { |
| 2359 | *path = '/'; |
| 2360 | memcpy(path + 1, src2, len2 + 1); |
| 2361 | } |
| 2362 | else { |
| 2363 | char *next; |
| 2364 | memcpy(path, src1, len1); |
| 2365 | next = path + len1; |
| 2366 | if (next[-1] != '/') { |
| 2367 | *next++ = '/'; |
| 2368 | } |
| 2369 | memcpy(next, src2, len2 + 1); |
| 2370 | } |
| 2371 | return path; |
| 2372 | } |
| 2373 | |
| 2374 | /* |
| 2375 | * Check for an absoluteURI syntax (see section 3.2 in RFC2068). |
no outgoing calls
no test coverage detected