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=='.')
115 if(*(dp=dir+1) == '.')
124 cdpath = path_nextcomp(shp,cdpath,dir,0);
166 if(rval<0 && *dir=='/' && *(path_relative(shp,stakptr(PATH_OFFSET)))!='/')
167 rval = chdir(dir);
173 errormsg(SH_DICT,ERROR_system(1),"%s:",dir);
176 if(dir == nv_getval(opwdnod) || argc==2)
177 dp = dir; /* print out directory for cd - */
180 dir = stakptr(PATH_OFFSET);
181 if (!(dir=pathcanon(dir,PATH_PHYSICAL)))
183 dir = stakptr(PATH_OFFSET);
184 errormsg(SH_DICT,ERROR_system(1),"%s:",dir);
186 stakseek(dir-stakptr(0));
188 dir = (char*)stakfreeze(1)+PATH_OFFSET;
189 if(*dp && (*dp!='.'||dp[1]) && strchr(dir,'/'))
190 sfputr(sfstdout,dir,'\n');
191 if(*dir != '/')
196 flag = strlen(dir);
198 while(--flag>0 && dir[flag]=='/')
199 dir[flag] = 0;
200 nv_putval(pwdnod,dir,NV_RDONLY);