Lines Matching refs:path
18 get_last_path_component(const char *path, char *buffer, int bufferLen)
20 int len = strlen(path);
25 while (len > 0 && path[len - 1] == '/')
29 // path is `/'
34 while (pos > 0 && path[pos] != '/')
36 if (path[pos] == '/')
39 path += pos;
46 memcpy(buffer, path, len);
60 // allocate the path
61 char *path = (char*)malloc(pathLen);
62 if (!path)
65 // compose the path
66 strcpy(path, dir);
68 strcat(path + dirLen, "/");
69 strcat(path + dirLen, entry);
71 return path;