Lines Matching refs:path
34 static int is_absolute_path(const char *path) in is_absolute_path() argument
36 return path[0] == '/'; in is_absolute_path()
58 static const char *make_nonrelative_path(const char *path) in make_nonrelative_path() argument
62 if (is_absolute_path(path)) { in make_nonrelative_path()
63 if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX) in make_nonrelative_path()
64 die("Too long path: %.*s", 60, path); in make_nonrelative_path()
69 if (snprintf(buf, PATH_MAX, "%s/%s", cwd, path) >= PATH_MAX) in make_nonrelative_path()
70 die("Too long path: %.*s", 60, path); in make_nonrelative_path()
75 char *system_path(const char *path) in system_path() argument
79 if (is_absolute_path(path)) in system_path()
80 return strdup(path); in system_path()
82 astrcatf(&buf, "%s/%s", subcmd_config.prefix, path); in system_path()
131 static void add_path(char **out, const char *path) in add_path() argument
133 if (path && *path) { in add_path()
134 if (is_absolute_path(path)) in add_path()
135 astrcat(out, path); in add_path()
137 astrcat(out, make_nonrelative_path(path)); in add_path()