Module Name:    src
Committed By:   kre
Date:           Fri Nov 23 23:37:22 UTC 2018

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

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/bin/sh/eval.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/eval.c
diff -u src/bin/sh/eval.c:1.162 src/bin/sh/eval.c:1.163
--- src/bin/sh/eval.c:1.162	Tue Oct  9 02:43:41 2018
+++ src/bin/sh/eval.c	Fri Nov 23 23:37:22 2018
@@ -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 @@ evalstring(char *s, int flag)
 			else
 				evaltree(n, flag);
 			any = 1;
+			if (evalskip)
+				break;
 		}
 		rststackmark(&smark);
 	}

Reply via email to