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 f82a772..a592904 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2316,6 +2316,7 @@
 		dest = bltinlookup(homestr);
 	else if (dest[0] == '-' && dest[1] == '\0') {
 		dest = bltinlookup("OLDPWD");
+		if ( !dest ) goto out;
 		flags |= CD_PRINT;
 		goto step7;
 	}