Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/sh Don't trash the logical $PWD if a component is a syml...
details: https://anonhg.NetBSD.org/src/rev/3b3330974ed9
branches: trunk
changeset: 819982:3b3330974ed9
user: christos <christos%NetBSD.org@localhost>
date: Mon Dec 26 02:27:57 2016 +0000
description:
Don't trash the logical $PWD if a component is a symlink; no other shell
does this.
diffstat:
bin/sh/cd.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diffs (29 lines):
diff -r 56fae303c793 -r 3b3330974ed9 bin/sh/cd.c
--- a/bin/sh/cd.c Mon Dec 26 01:26:25 2016 +0000
+++ b/bin/sh/cd.c Mon Dec 26 02:27:57 2016 +0000
@@ -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 @@
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;
}
Home |
Main Index |
Thread Index |
Old Index