Lines Matching refs:path
31 static int is_absolute_path(const char *path)
33 return path[0] == '/';
55 static const char *make_nonrelative_path(const char *path)
59 if (is_absolute_path(path)) {
60 if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
61 die("Too long path: %.*s", 60, path);
66 if (snprintf(buf, PATH_MAX, "%s/%s", cwd, path) >= PATH_MAX)
67 die("Too long path: %.*s", 60, path);
72 char *system_path(const char *path)
76 if (is_absolute_path(path))
77 return strdup(path);
79 astrcatf(&buf, "%s/%s", subcmd_config.prefix, path);
128 static void add_path(char **out, const char *path)
130 if (path && *path) {
131 if (is_absolute_path(path))
132 astrcat(out, path);
134 astrcat(out, make_nonrelative_path(path));