]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* read.c (eval): [SV 47960] Skip record waiting files when ignoring.
authorPaul Smith <psmith@gnu.org>
Sat, 21 May 2016 17:08:34 +0000 (13:08 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 21 May 2016 20:22:32 +0000 (16:22 -0400)
* tests/scripts/features/conditionals: Test this scenario.

read.c
tests/scripts/features/conditionals

diff --git a/read.c b/read.c
index 5de5a4835f87759b5aa0c447748278d360ecd345..b870aa85512c29c9ea1c5a53d11e912e1e100ef7 100644 (file)
--- a/read.c
+++ b/read.c
@@ -724,9 +724,6 @@ eval (struct ebuffer *ebuf, int set_default)
           struct variable *v;
           enum variable_origin origin = vmod.override_v ? o_override : o_file;
 
-          /* Variable assignment ends the previous rule.  */
-          record_waiting_files ();
-
           /* If we're ignoring then we're done now.  */
           if (ignoring)
             {
@@ -735,6 +732,9 @@ eval (struct ebuffer *ebuf, int set_default)
               continue;
             }
 
+          /* Variable assignment ends the previous rule.  */
+          record_waiting_files ();
+
           if (vmod.undefine_v)
           {
             do_undefine (p, origin, ebuf);
index 2ece60bbd66d3fa43f177f44c5f87949548f7dc6..78344b93896794a999ebac85dc6f4725bdf50190 100644 (file)
@@ -141,6 +141,22 @@ all: ; @:',
               '',
               'success');
 
+# SV 47960 : ensure variable assignments in non-taken legs don't cause problems
+run_make_test('
+ifneq ($(FOO),yes)
+target:
+else
+BAR = bar
+target:
+endif
+       @echo one
+',
+              '', "one\n");
+
 
 # This tells the test driver that the perl test script executed properly.
 1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End: