Module Name: src
Committed By: christos
Date: Mon Dec 26 02:27:57 UTC 2016
Modified Files:
src/bin/sh: cd.c
Log Message:
Don't trash the logical $PWD if a component is a symlink; no other shell
does this.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/bin/sh/cd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/cd.c
diff -u src/bin/sh/cd.c:1.46 src/bin/sh/cd.c:1.47
--- src/bin/sh/cd.c:1.46 Sun May 1 21:46:31 2016
+++ src/bin/sh/cd.c Sun Dec 25 21:27:57 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.46 2016/05/02 01:46:31 christos Exp $ */
+/* $NetBSD: cd.c,v 1.47 2016/12/26 02:27:57 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: cd.c,v 1.46 2016/05/02 01:46:31 christos Exp $");
+__RCSID("$NetBSD: cd.c,v 1.47 2016/12/26 02:27:57 christos Exp $");
#endif
#endif /* not lint */
@@ -190,9 +190,7 @@ docd(const char *dest, int print)
if (equal(component, ".."))
continue;
STACKSTRNUL(p);
- if ((lstat(stackblock(), &statb) < 0)
- || (S_ISLNK(statb.st_mode))) {
- /* print = 1; */
+ if (lstat(stackblock(), &statb) < 0) {
badstat = 1;
break;
}