From 02601ee91226d216502307a86d992be9c5e63ed4 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 14 Dec 1995 01:22:31 +0000 Subject: 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] --- bin/sh/parser.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bin/sh/parser.c') 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); -- cgit v1.2.3