summaryrefslogtreecommitdiff
path: root/bin/sh/cd.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-03-03 12:33:53 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-03-03 12:33:53 +0000
commit1017c29793838bf57e48d99b824f3237afaffebd (patch)
tree23a20232f6935b821077a5b17418ad70f7fb1773 /bin/sh/cd.c
parent503a3a4cf5bad39ef16c2ec719b93414a6ee3c89 (diff)
From NetBSD:
Changed so that INTOFF/INTON are paired in getpwd(). From Matthias Pfaller <leo@marco.de>. Fixes PR #2130.
Diffstat (limited to 'bin/sh/cd.c')
-rw-r--r--bin/sh/cd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/sh/cd.c b/bin/sh/cd.c
index 1a275d78949..08a08bbf34e 100644
--- a/bin/sh/cd.c
+++ b/bin/sh/cd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.14 1995/11/19 23:27:37 christos Exp $ */
+/* $NetBSD: cd.c,v 1.15 1996/03/01 01:58:58 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$NetBSD: cd.c,v 1.14 1995/11/19 23:27:37 christos Exp $";
+static char rcsid[] = "$NetBSD: cd.c,v 1.15 1996/03/01 01:58:58 jtc Exp $";
#endif
#endif /* not lint */
@@ -259,6 +259,7 @@ getpwd()
#if defined(__NetBSD__) || defined(__svr4__)
if (getcwd(buf, sizeof(buf)) == NULL)
error("getcwd() failed");
+ curdir = savestr(buf);
#else
{
char *p;
@@ -298,7 +299,7 @@ getpwd()
error("pwd command failed");
p[-1] = '\0';
}
-#endif
curdir = savestr(buf);
INTON;
+#endif
}