Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Handle eval $'continue\ncommand' (and similar) in a l...



details:   https://anonhg.NetBSD.org/src/rev/0871a6dfede4
branches:  trunk
changeset: 446105:0871a6dfede4
user:      kre <kre%NetBSD.org@localhost>
date:      Fri Nov 23 23:37:22 2018 +0000

description:
Handle eval $'continue\ncommand' (and similar) in a loop correctly ...
"command" should not be executed.  (The issue affects multi-line
eval strings only - ie: commands after the next \n are not skipped).

Bug noted by Martijn Dekker in off-list e-mail.

Fix from FreeBSD:
src/bin/sh/eval.c: Revision 272983 Sun Oct 12 13:12:06 2014 UTC by jilles

diffstat:

 bin/sh/eval.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 6172f0be3510 -r 0871a6dfede4 bin/sh/eval.c
--- a/bin/sh/eval.c     Fri Nov 23 20:40:06 2018 +0000
+++ b/bin/sh/eval.c     Fri Nov 23 23:37:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.162 2018/10/09 02:43:41 kre Exp $   */
+/*     $NetBSD: eval.c,v 1.163 2018/11/23 23:37:22 kre Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c     8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.162 2018/10/09 02:43:41 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.163 2018/11/23 23:37:22 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -233,6 +233,8 @@
                        else
                                evaltree(n, flag);
                        any = 1;
+                       if (evalskip)
+                               break;
                }
                rststackmark(&smark);
        }



Home | Main Index | Thread Index | Old Index