summaryrefslogtreecommitdiff
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 01:22:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 01:22:31 +0000
commit02601ee91226d216502307a86d992be9c5e63ed4 (patch)
tree3806082c5ba14a0d6e3b0e0b0dce967baf34a87f /bin/sh/parser.c
parentbe5133be93f99257ff553dce82b4027ab1b0c036 (diff)
update from netbsd, including:
Fix PR/1760, where 'cd -' before any other command could cause a reference to an uninitialized pointer. Use getcwd() to get the current working directory, instead of forking /bin/pwd [per Scott's suggestion]
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r--bin/sh/parser.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 9614e58e9ec..d70b3ebb9c3 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parser.c,v 1.26 1995/05/17 00:05:25 christos Exp $ */
+/* $NetBSD: parser.c,v 1.27 1995/10/19 04:14:41 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#else
-static char rcsid[] = "$NetBSD: parser.c,v 1.26 1995/05/17 00:05:25 christos Exp $";
+static char rcsid[] = "$NetBSD: parser.c,v 1.27 1995/10/19 04:14:41 christos Exp $";
#endif
#endif /* not lint */
@@ -1289,9 +1289,14 @@ parsebackq: {
if (!oldstyle && (readtoken() != TRP))
synexpect(TRP);
(*nlpp)->n = n;
- /* Start reading from old file again. */
- if (oldstyle)
+ if (oldstyle) {
+ /*
+ * Start reading from old file again, ignoring any pushed back
+ * tokens left from the backquote parsing
+ */
popfile();
+ tokpushback = 0;
+ }
while (stackblocksize() <= savelen)
growstackblock();
STARTSTACKSTR(out);