Lines Matching defs:path
34 static int is_absolute_path(const char *path)
36 return path[0] == '/';
57 static const char *make_nonrelative_path(char *buf, size_t sz, const char *path)
59 if (is_absolute_path(path)) {
60 if (strlcpy(buf, path, sz) >= sz)
61 die("Too long path: %.*s", 60, path);
68 if (strlen(cwd) + strlen(path) + 2 >= sz)
69 die("Too long path: %.*s", 60, path);
72 strcat(buf, path);
77 char *system_path(const char *path)
81 if (is_absolute_path(path))
82 return strdup(path);
84 astrcatf(&buf, "%s/%s", subcmd_config.prefix, path);
133 static void add_path(char **out, const char *path)
135 if (path && *path) {
136 if (is_absolute_path(path))
137 astrcat(out, path);
141 astrcat(out, make_nonrelative_path(buf, sizeof(buf), path));