Lines Matching refs:path
48 xdirname_r(const char *path, char *buf, size_t buflen)
54 * If `path' is a null pointer or points to an empty string,
57 if (path == NULL || *path == '\0') {
58 path = ".";
64 endp = path + strlen(path) - 1;
65 while (endp != path && *endp == '/')
69 while (endp > path && *endp != '/')
72 if (endp == path) {
73 path = *endp == '/' ? "/" : ".";
80 while (endp > path && *endp == '/');
82 len = endp - path + 1;
86 if (buf != path)
87 memcpy(buf, path, buflen);
95 dirname(char *path)
98 (void)xdirname_r(path, result, sizeof(result));