Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh After discussions with Jilles Tjoelker (FreeBSD shell...



details:   https://anonhg.NetBSD.org/src/rev/e197fc4e4035
branches:  trunk
changeset: 344458:e197fc4e4035
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 31 13:27:44 2016 +0000

description:
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@)

diffstat:

 bin/sh/expand.c |  9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diffs (30 lines):

diff -r 9ea08d7829d9 -r e197fc4e4035 bin/sh/expand.c
--- a/bin/sh/expand.c   Thu Mar 31 06:59:44 2016 +0000
+++ b/bin/sh/expand.c   Thu Mar 31 13:27:44 2016 +0000
@@ -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 @@
 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);



Home | Main Index | Thread Index | Old Index