From c00e11df856d280d7cff64aed78385e5f8be26bd Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 8 Oct 2004 08:14:58 +0000 Subject: [PATCH] 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. --- shell/ash.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.25.1