Lines Matching refs:path
60 * char *realpath(const char *path, char *resolved);
62 * Find the real name of path, by removing all ".", ".." and symlink
64 * in which case the path which caused trouble is left in (resolved).
67 realpath(const char * __restrict path, char * __restrict resolved)
77 if (path == NULL) {
91 * Build real path one by one with paying an attention to .,
101 if (*path == '\0') {
107 /* If relative path, start from current working directory. */
108 if (*path != '/') {
122 while (*path == '/')
123 path++;
125 if (*path == '\0') {
133 q = path;
139 if (path[0] == '.') {
140 if (q - path == 1) {
141 path = q;
144 if (path[1] == '.' && q - path == 2) {
149 path = q;
155 if (p - resolved + 1 + q - path + 1 > MAXPATHLEN) {
163 memcpy(&p[1], path,
164 /* LINTED We know q > path. */
165 q - path);
166 p[1 + q - path] = '\0';
170 * target to unresolved path.
188 /* Append unresolved path to link target and switch to it. */
194 path = wbuf[idx];
198 if (*path == '/')
207 /* Advance both resolved and unresolved path. */
208 p += 1 + q - path;
209 path = q;