From: Eric Andersen Date: Fri, 8 Oct 2004 08:14:58 +0000 (-0000) Subject: Hiroshi Ito writes: X-Git-Tag: 1_00~16 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c00e11df856d280d7cff64aed78385e5f8be26bd;p=oweals%2Fbusybox.git 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. --- diff --git a/shell/ash.c b/shell/ash.c index f82a77258..a5929044b 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; }