cwd
if ((cwd = getenv("PWD")) != NULL) {
if (stat(cwd, &shp) != -1 && swd.st_dev == shp.st_dev &&
tcp = cwd;
Char *dp, *cwd;
cwd = xreallocarray(NULL, len, sizeof(Char));
(void) Strlcpy(cwd, dcwd->di_name, len);
if ((dp = Strrchr(cwd, '/'))) {
cwd[dotdot = Strlen(cwd)] = '/';
cwd[dotdot + 1] = '\0';
dp = Strspl(cwd, cp);
free(cwd);
if (!*cwd) {
cwd[0] = '/';
cwd[1] = '\0';
return cwd;
char *cwd;
make_path(const char *cwd, const char *file,
(cwd && *cwd)) {
len = strlen(cwd);
memcpy(xp, cwd, len);
if (cwd[len - 1] != '/')
void cwd(char *);
cwd(pw->pw_dir);
cwd($4);
cwd("..");
char cwd[PATH_MAX + 1];
if (getcwd(cwd, sizeof cwd - 1) == NULL)
clen = strlen(cwd);
cwd[clen++] = '/';
cwd[clen] = '\0';
try_mkstemp(p, cwd, i);
try_mkstemp(p + pg - clen - i - 1, cwd, i);
try_mkstemps(p, cwd, i, "");
try_mkstemps(p + pg - clen - i - 1, cwd, i, "");
try_mkstemps(p, cwd, i, SUFFIX);
try_mkstemps(p + pg - clen - i - SLEN - 1, cwd, i, SUFFIX);
char *cwd, *dir, *path = NULL;
cwd = argv[1];
if (chdir(cwd) == -1)
err(1, "chdir %s", cwd);
char *cwd, *dir, *file, *path = NULL;
cwd = argv[1];
if (chdir(cwd) == -1)
err(1, "chdir %s", cwd);
fileerror(ino_t cwd, ino_t ino, char *errmesg)
getpathname(pathbuf, sizeof pathbuf, cwd, ino);
fileerror(ino_t cwd, ino_t ino, char *errmesg)
getpathname(pathbuf, sizeof pathbuf, cwd, ino);
if (getcwd(cwd, sizeof(cwd)) == NULL)
writefile(cwd, timer, queue);
writefile(cwd, timer, queue);
writefile(const char *cwd, time_t runtimer, char queue)
for (ap = cwd; *ap != '\0'; ap++) {
char cwd[PATH_MAX];
cwd = xstrdup(p);
getlogin(), cwd, repo, rev,
free(cwd);
char *cwd, *p, *rev;
cwd = "<remote>";
if ((wdir = getcwd(cwd, sizeof(cwd))) == NULL)
char *wdir, cwd[PATH_MAX];
const char *cwd;
cwd = "(failed)";
cwd = cwdpath;
mypw->pw_name, cmdline, targpw->pw_name, cwd);
char *dir, *cwd;
cwd = getcwd(NULL, 0);
if (cwd == NULL)
if (stat(cwd, &sa) == -1)
err(2, "%s", cwd);
free(cwd);
return cwd;
char cwd[NFILEN];
if (getcwdir(cwd, sizeof(cwd)) == FALSE)
(void)strlcpy(path, cwd, plen);
char cwd[NFILEN], qcmd[NFILEN];
if (getcwd(cwd, sizeof(cwd)) == NULL)
if (chdir(cwd) == -1) {
ewprintf("Can't change dir back to %s", cwd);
char *expanded, *ret, cwd[PATH_MAX];
if (getcwd(cwd, sizeof(cwd)) == NULL)
xasprintf(&ret, "%s/%s", cwd, expanded);
char cwd[PATH_MAX], resolvedname[PATH_MAX];
if (getcwd(cwd, sizeof(cwd)) == NULL) {
path = xstrdup(cwd);
xasprintf(&path, "%s/%s", cwd, npath);
xasprintf(&npath, "%s/%s", cwd, path);
const char *ttynam, *termname, *cwd;
if ((cwd = find_cwd()) == NULL && (cwd = find_home()) == NULL)
cwd = "/";
client_send_identify(ttynam, termname, caps, ncaps, cwd, feat);
u_int ncaps, const char *cwd, int feat)
proc_send(client_peer, MSG_IDENTIFY_CWD, -1, cwd, strlen(cwd) + 1);
cwd = format_single(item, cflag, c, s, wl, wp);
free((void *)s->cwd);
s->cwd = cwd;
char *cwd, *cause;
char *cwd = NULL, *cause = NULL, **argv = NULL;
cwd = format_single_from_target(item, value);
cwd = xstrdup(server_client_get_cwd(tc, s));
argv, cwd, title, tc, s, style, border_style, NULL, NULL) != 0)
free(cwd);
free(cwd);
free(cwd);
cwd = format_single(item, tmp, c, NULL, NULL, NULL);
cwd = xstrdup(server_client_get_cwd(c, NULL));
s = session_create(prefix, newname, cwd, env, oo, tiop);
sc.cwd = args_get(args, 'c');
free(cwd);
free(cwd);
char *cause, *cwd = NULL, *cp, *newname = NULL;
sc.cwd = args_get(args, 'c');
sc.cwd = args_get(args, 'c');
sc.cwd = args_get(args, 'c');
cdata->cwd = xstrdup(args_get(args, 'c'));
cdata->cwd = xstrdup(server_client_get_cwd(c, s));
if (job_run(cmd, 0, NULL, NULL, cdata->s, cdata->cwd, NULL,
free(cdata->cwd);
char *cwd;
char *pattern, *cwd, *expanded = NULL;
cwd = cmd_source_file_quote_for_glob(server_client_get_cwd(c, NULL));
xasprintf(&pattern, "%s/%s", cwd, path);
free(cwd);
sc.cwd = args_get(args, 'c');
return (xstrdup(ft->s->cwd));
if (wp->cwd == NULL)
return (xstrdup(wp->cwd));
char *cwd;
cwd = get_proc_cwd(wp->fd);
if (cwd == NULL)
return (xstrdup(cwd));
cwd == NULL ? "" : cwd, shell);
cwd == NULL ? "" : cwd, shell);
if (cwd != NULL) {
if (chdir(cwd) == 0)
environ_set(env, "PWD", 0, "%s", cwd);
struct session *s, const char *cwd, job_update_cb updatecb,
int argc, char **argv, const char *cwd, const char *title, struct client *c,
pd->job = job_run(shellcmd, argc, argv, env, s, cwd,
c->cwd = xstrdup(data);
c->cwd = xstrdup(home);
c->cwd = xstrdup("/");
return (cfg_client->cwd);
if (c != NULL && c->session == NULL && c->cwd != NULL)
return (c->cwd);
if (s != NULL && s->cwd != NULL)
return (s->cwd);
if (c != NULL && (s = c->session) != NULL && s->cwd != NULL)
return (s->cwd);
free((void *)c->cwd);
session_create(const char *prefix, const char *name, const char *cwd,
s->cwd = xstrdup(cwd);
free((void *)s->cwd);
char **argv, *cp, **argvp, *argv0, *cwd, *new_cwd;
if (sc->cwd != NULL) {
cwd = format_single(item, sc->cwd, c, target->s, NULL, NULL);
if (*cwd != '/') {
*cwd != '\0' ? "/" : "", cwd);
free(cwd);
cwd = new_cwd;
cwd = xstrdup(server_client_get_cwd(c, target->s));
cwd = NULL;
free(cwd);
if (cwd != NULL) {
free(new_wp->cwd);
new_wp->cwd = cwd;
log_debug("%s: cwd=%s", __func__, new_wp->cwd);
if (chdir(new_wp->cwd) == 0)
actual_cwd = new_wp->cwd;
static char cwd[PATH_MAX];
if (getcwd(cwd, sizeof cwd) == NULL)
return (cwd);
return (cwd);
if (realpath(cwd, resolved2) == NULL)
return (cwd);
return (cwd);
const char *s, *cwd;
if ((cwd = find_cwd()) != NULL)
environ_set(global_environ, "PWD", 0, "%s", cwd);
char *cwd;
const char *cwd;
free((void *)wp->cwd);
char *cp, *obj, tempfname[PATH_MAX], cwd[PATH_MAX];
getcwd(cwd, sizeof(cwd)) == NULL) {
snprintf(line, sizeof(line), "make -f %s/%s crunchgen_objs 2>&1", cwd, tempfname);