Lines Matching defs:path
27 * in-place path name canonicalization -- preserves the logical view
28 * pointer to trailing 0 in path returned
36 * if (flags&PATH_EXISTS) then path must exist at each component
37 * if (flags&PATH_VERIFIED(n)) then first n chars of path exist
40 * 0 returned on error and if (flags&(PATH_DOTDOT|PATH_EXISTS)) then path
50 pathcanon(char* path, int flags)
67 phys = path;
68 v = path + ((flags >> 5) & 01777);
69 if (*path == '/')
71 if (*(path + 1) == '/' && *astconf("PATH_LEADING_SLASHES", NiL, NiL) == '1')
72 do path++; while (*path == '/' && *(path + 1) == '/');
73 if (!*(path + 1))
74 return path + 1;
76 p = r = s = t = path;
100 strcpy(path, s);
124 if ((t -= 5) <= path) t = path + 1;
129 r = path;
144 if ((flags & PATH_PHYSICAL) && loop < 32 && (t - 1) > path)
157 if (*buf == '/') p = r = path;
165 strcpy(path, s);
174 if (dots >= 4 && (flags & PATH_EXISTS) && (t - 1) >= v && (t > path + 1 || t > path && *(t - 1) && *(t - 1) != '/'))
181 strcpy(path, s);
189 if (t > path && !*(t - 1)) t--;
190 if (t == path) *t++ = '.';
192 else if (t > path + 1 && *(t - 1) == '/') t--;
194 else if ((s <= path || *(s - 1) != '/') && t > path + 1 && *(t - 1) == '/') t--;