Lines Matching refs:dir
54 register char *dir;
81 dir = argv[0];
88 dir = sh_substitute(oldpwd,dir,argv[1]);
89 else if(!dir)
90 dir = nv_getval(HOME);
91 else if(*dir == '-' && dir[1]==0)
92 dir = nv_getval(opwdnod);
93 if(!dir || *dir==0)
96 if(*dir != '/' && (dir[1]!=':'))
98 if(*dir != '/')
112 if(*dir=='.')
117 for(dp=dir; *dp=='.'; dp++)
139 dir = sfstruse(shp->strbuf);
146 cdpath = path_nextcomp(shp,cdpath,dir,0);
188 if(rval<0 && *dir=='/' && *(path_relative(shp,stakptr(PATH_OFFSET)))!='/')
189 rval = chdir(dir);
195 errormsg(SH_DICT,ERROR_system(1),"%s:",dir);
198 if(dir == nv_getval(opwdnod) || argc==2)
199 dp = dir; /* print out directory for cd - */
202 dir = stakptr(PATH_OFFSET);
203 if (!(dir=pathcanon(dir,PATH_PHYSICAL)))
205 dir = stakptr(PATH_OFFSET);
206 errormsg(SH_DICT,ERROR_system(1),"%s:",dir);
208 stakseek(dir-stakptr(0));
210 dir = (char*)stakfreeze(1)+PATH_OFFSET;
211 if(*dp && (*dp!='.'||dp[1]) && strchr(dir,'/'))
212 sfputr(sfstdout,dir,'\n');
213 if(*dir != '/')
216 flag = strlen(dir);
218 while(--flag>0 && dir[flag]=='/')
219 dir[flag] = 0;
220 nv_putval(pwdnod,dir,NV_RDONLY);