projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b477e18
)
msh: fix my buglet
author
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 9 Feb 2007 17:30:14 +0000
(17:30 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 9 Feb 2007 17:30:14 +0000
(17:30 -0000)
shell/msh.c
patch
|
blob
|
history
diff --git
a/shell/msh.c
b/shell/msh.c
index a2da540b32a945710437964e26aeba50966b4f65..968f073cd7d2b78b31c8b3cd7630f91c0125b265 100644
(file)
--- a/
shell/msh.c
+++ b/
shell/msh.c
@@
-3157,12
+3157,15
@@
static int dochdir(struct op *t)
cp = t->words[1];
if (cp == NULL) {
cp = homedir->value;
- if (cp == NULL)
- er = ": no home directory";
- } else if (chdir(cp) < 0)
+ if (cp != NULL)
+ goto do_cd;
+ er = ": no home directory";
+ } else {
+ do_cd:
+ if (chdir(cp) >= 0)
+ return 0;
er = ": bad directory";
- else
- return 0;
+ }
prs(cp != NULL ? cp : "cd");
err(er);
return 1;