Lines Matching defs:path
40 char path[APR_PATH_MAX];
42 if (!getcwd(path, sizeof(path))) {
48 *defpath = apr_pstrdup(p, path);
56 APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p)
58 if (chdir(path) != 0)
87 char *path;
89 apr_size_t maxlen; /* maximum total path length */
91 apr_size_t pathlen; /* is the length of the result path */
95 /* Treat null as an empty path.
112 * Waste no CPU retrieving the working path.
120 * ommitted, we do not retrieve the working path,
132 /* Start with the current working path. This is bass akwards,
156 path = (char *)apr_palloc(p, maxlen);
159 /* Ignore the given root path, strip off leading
166 path[0] = '/';
175 /* Base the result path on the rootpath
178 memcpy(path, rootpath, rootlen);
180 /* Always '/' terminate the given root path
182 if (keptlen && path[keptlen - 1] != '/') {
183 path[keptlen++] = '/';
203 if (pathlen == 1 && path[0] == '/') {
218 && !memcmp(path + pathlen - 3, "../", 3))
220 && !memcmp(path + pathlen - 4, "/../", 4))) {
231 memcpy(path + pathlen, "../", *next ? 3 : 2);
239 } while (pathlen && path[pathlen - 1] != '/');
243 * the keptlen offset to reflect the added/altered path.
253 /* An actual segment, append it to the destination path
258 memcpy(path + pathlen, addpath, seglen);
270 path[pathlen] = '\0';
275 * compare the original root to assure the result path is
276 * still within given root path.
279 if (strncmp(rootpath, path, rootlen)) {
283 && path[rootlen] && path[rootlen] != '/') {
288 *newpath = path;