summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEric Andersen2004-10-08 08:14:58 +0000
committerEric Andersen2004-10-08 08:14:58 +0000
commitc00e11df856d280d7cff64aed78385e5f8be26bd (patch)
treebb3966123f6881cc9aa72375aa9de483d4e80b60 /shell
parent31c27a9c6559b46c5e20fd64eaa8019daaba5e5c (diff)
downloadbusybox-c00e11df856d280d7cff64aed78385e5f8be26bd.zip
busybox-c00e11df856d280d7cff64aed78385e5f8be26bd.tar.gz
Hiroshi Ito writes:
ash "unset OLDPWD; cd -" causes segmentation fault. ( OLDPWD is not set when sh is invoked from getty. ) patch against current CVS is attached.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index f82a772..a592904 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2316,6 +2316,7 @@ cdcmd(int argc, char **argv)
dest = bltinlookup(homestr);
else if (dest[0] == '-' && dest[1] == '\0') {
dest = bltinlookup("OLDPWD");
+ if ( !dest ) goto out;
flags |= CD_PRINT;
goto step7;
}