Lines Matching defs:buf
39 static const char *get_pwd_cwd(char *buf, size_t sz)
43 if (getcwd(buf, sz) == NULL)
46 if (pwd && strcmp(pwd, buf)) {
47 stat(buf, &cwd_stat);
51 strlcpy(buf, pwd, sz);
54 return buf;
57 static const char *make_nonrelative_path(char *buf, size_t sz, const char *path)
60 if (strlcpy(buf, path, sz) >= sz)
63 const char *cwd = get_pwd_cwd(buf, sz);
71 strcat(buf, "/");
72 strcat(buf, path);
74 return buf;
79 char *buf = NULL;
84 astrcatf(&buf, "%s/%s", subcmd_config.prefix, path);
86 return buf;
139 char buf[PATH_MAX];
141 astrcat(out, make_nonrelative_path(buf, sizeof(buf), path));