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()
57 static const char *make_nonrelative_path(char *buf, size_t sz, const char *path) in make_nonrelative_path() argument
59 if (is_absolute_path(path)) { in make_nonrelative_path()
60 if (strlcpy(buf, path, sz) >= sz) in make_nonrelative_path()
61 die("Too long path: %.*s", 60, path); in make_nonrelative_path()
68 if (strlen(cwd) + strlen(path) + 2 >= sz) in make_nonrelative_path()
69 die("Too long path: %.*s", 60, path); in make_nonrelative_path()
72 strcat(buf, path); in make_nonrelative_path()
77 char *system_path(const char *path) in system_path() argument
81 if (is_absolute_path(path)) in system_path()
82 return strdup(path); in system_path()
84 astrcatf(&buf, "%s/%s", subcmd_config.prefix, path); in system_path()
133 static void add_path(char **out, const char *path) in add_path() argument
135 if (path && *path) { in add_path()
136 if (is_absolute_path(path)) in add_path()
137 astrcat(out, path); in add_path()
141 astrcat(out, make_nonrelative_path(buf, sizeof(buf), path)); in add_path()