Module Name:    src
Committed By:   christos
Date:           Thu Mar 31 13:27:44 UTC 2016

Modified Files:
        src/bin/sh: expand.c

Log Message:
After discussions with Jilles Tjoelker (FreeBSD shell) and following
a suggestion from him, the way the fix to PR bin/50993 was implemented
has changed a little.   There are three steps involved in processing
a here document, reading it, parsing it, and then evaluating it
before applying it to the correct file descriptor for the command
to use.  The third of those is not related to this problem, and
has not changed.  The bug was caused by combining the first two
steps into one (and not doing it correctly - which would be hard
that way.)  The fix is to split the first two stages into separate
events.   The original fix moved the 2nd stage (parsing) to just
immediately before the 3rd stage (evaluation.)  Jilles pointed out
some unwanted side effects from doing it that way, and suggested
moving the 2nd stage to immediately after the first.  This commit
makes that change.  The effect is to revert the changes to expand.c
and parser.h (which are no longer needed) and simplify slightly
the change to parser.c. (from kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/bin/sh/expand.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/expand.c
diff -u src/bin/sh/expand.c:1.99 src/bin/sh/expand.c:1.100
--- src/bin/sh/expand.c:1.99	Sun Mar 27 10:39:33 2016
+++ src/bin/sh/expand.c	Thu Mar 31 09:27:44 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: expand.c,v 1.99 2016/03/27 14:39:33 christos Exp $	*/
+/*	$NetBSD: expand.c,v 1.100 2016/03/31 13:27:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c	8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.99 2016/03/27 14:39:33 christos Exp $");
+__RCSID("$NetBSD: expand.c,v 1.100 2016/03/31 13:27:44 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -121,11 +121,6 @@ STATIC char *cvtnum(int, char *);
 void
 expandhere(union node *arg, int fd)
 {
-	/*
-	 * First, parse the content of the here doc (to internal form)
-	 * It was initially saved as (almost) unmodified text.
-	 */
-	parse_heredoc(arg);
 
 	herefd = fd;
 	expandarg(arg, NULL, 0);

Reply via email to