MCPcopy Create free account
hub / github.com/apache/httpd / ap_make_full_path

Function ap_make_full_path

server/util.c:2346–2372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2344}
2345
2346AP_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).

Callers 10

find_content_lengthFunction · 0.85
make_parent_entryFunction · 0.85
make_autoindex_entryFunction · 0.85
ap_open_htaccessFunction · 0.85
ap_dir_nofnmatchFunction · 0.85
ap_dir_fnmatchFunction · 0.85
ap_directory_walkFunction · 0.85
ap_sub_req_method_uriFunction · 0.85
ap_sub_req_lookup_direntFunction · 0.85
ap_sub_req_lookup_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected