Lines Matching refs:curdir
77 char *curdir = NULL; /* current working directory */
98 * Try (quite hard) to have 'curdir' defined, nothing has set
109 if (!curdir)
111 p = strstr(curdir, dest);
114 d = stalloc(strlen(curdir) + strlen(argptr[1]) + 1);
115 memcpy(d, curdir, p - curdir);
116 strcpy(d + (p - curdir), argptr[1]);
121 dest = prevdir ? prevdir : curdir;
170 * something we can't stat, clear curdir to force a getcwd()
212 out1fmt("%s\n", gotpwd ? curdir : dest);
245 * Update curdir (the name of the current directory) in response to a
263 if (dir == NULL || curdir == NULL) {
267 prevdir = curdir;
268 curdir = NULL;
271 if (curdir) {
273 setvar("PWD", curdir, VEXPORT);
286 p = curdir;
307 prevdir = curdir;
308 curdir = savestr(stackblock());
310 setvar("PWD", curdir, VEXPORT);
359 setvar("PWD", curdir, VEXPORT);
362 if (!is_curdir(curdir)) {
364 if (curdir == NULL)
370 out1str(curdir);
385 if (curdir)
386 setvar("PWD", curdir, VEXPORT);
403 if (curdir)
424 curdir = savestr(pwd);
464 curdir = savestr(pwd);
515 curdir = savestr(pwd);