Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): fix line numbers in .for loops (since ...



details:   https://anonhg.NetBSD.org/src/rev/c341f61d71c6
branches:  trunk
changeset: 947598:c341f61d71c6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Dec 19 12:24:46 2020 +0000

description:
make(1): fix line numbers in .for loops (since 2007-01-01)

diffstat:

 usr.bin/make/parse.c                            |   8 ++++----
 usr.bin/make/unit-tests/directive-for-lines.exp |  12 ++++++------
 usr.bin/make/unit-tests/directive-for-lines.mk  |  10 +++++-----
 3 files changed, 15 insertions(+), 15 deletions(-)

diffs (68 lines):

diff -r 6fe581055881 -r c341f61d71c6 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Dec 19 12:14:59 2020 +0000
+++ b/usr.bin/make/parse.c      Sat Dec 19 12:24:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.493 2020/12/19 10:57:17 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.494 2020/12/19 12:24:46 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.493 2020/12/19 10:57:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.494 2020/12/19 12:24:46 rillig Exp $");
 
 /* types and constants */
 
@@ -2814,8 +2814,8 @@
                if (line_end == line || firstComment == line) {
                        if (res == PRLR_EOF)
                                return NULL;
-                       /* Parse another line */
-                       continue;
+                       if (mode != PARSE_RAW)
+                               continue;
                }
 
                /* We now have a line of data */
diff -r 6fe581055881 -r c341f61d71c6 usr.bin/make/unit-tests/directive-for-lines.exp
--- a/usr.bin/make/unit-tests/directive-for-lines.exp   Sat Dec 19 12:14:59 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-for-lines.exp   Sat Dec 19 12:24:46 2020 +0000
@@ -1,9 +1,9 @@
-make: "directive-for-lines.mk" line 12: expect 18
-make: "directive-for-lines.mk" line 12: expect 18
-make: "directive-for-lines.mk" line 14: expect 24
-make: "directive-for-lines.mk" line 12: expect 18
-make: "directive-for-lines.mk" line 12: expect 18
-make: "directive-for-lines.mk" line 14: expect 24
+make: "directive-for-lines.mk" line 18: expect 18
+make: "directive-for-lines.mk" line 18: expect 18
+make: "directive-for-lines.mk" line 24: expect 24
+make: "directive-for-lines.mk" line 18: expect 18
+make: "directive-for-lines.mk" line 18: expect 18
+make: "directive-for-lines.mk" line 24: expect 24
 make: no target to make.
 
 make: stopped in unit-tests
diff -r 6fe581055881 -r c341f61d71c6 usr.bin/make/unit-tests/directive-for-lines.mk
--- a/usr.bin/make/unit-tests/directive-for-lines.mk    Sat Dec 19 12:14:59 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-for-lines.mk    Sat Dec 19 12:24:46 2020 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: directive-for-lines.mk,v 1.1 2020/12/19 12:14:59 rillig Exp $
+# $NetBSD: directive-for-lines.mk,v 1.2 2020/12/19 12:24:46 rillig Exp $
 #
 # Tests for the line numbers that are reported in .for loops.
 #
-# Since 2007-01-01 21:47:32 (git 4d3c468f96e1080e4d3cca8cc39067a73af14fbb),
-# parse.c 1.127, the line numbers for the .info directives and error messages
-# inside .for loops have been wrong since ParseGetLine skips empty lines, even
-# when collecting the lines for the .for loop body.
+# Between 2007-01-01 (git 4d3c468f96e1080e, parse.c 1.127) and 2020-12-19
+# (parse.c 1.494), the line numbers for the .info directives and error
+# messages inside .for loops had been wrong since ParseGetLine skipped empty
+# lines, even when collecting the lines for the .for loop body.
 
 .for outer in a b
 



Home | Main Index | Thread Index | Old Index