Source-Changes-HG archive

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

[.joined/src/trunk]: .joined/src/usr.bin/make make: fix line number in error ...



details:   https://anonhg.NetBSD.org/.joined/src/rev/567607d991bf
branches:  trunk
changeset: 359392:567607d991bf
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 02 00:07:20 2022 +0000

description:
make: fix line number in error message about open conditionals

diffstat:

 usr.bin/make/parse.c                                       |  9 +++++----
 usr.bin/make/unit-tests/directive-for-generating-endif.exp |  2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 175d219760fe -r 567607d991bf usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Jan 01 22:01:18 2022 +0000
+++ b/usr.bin/make/parse.c      Sun Jan 02 00:07:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.614 2022/01/01 21:50:29 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.615 2022/01/02 00:07:20 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -110,7 +110,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.614 2022/01/01 21:50:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.615 2022/01/02 00:07:20 rillig Exp $");
 
 /* types and constants */
 
@@ -2390,9 +2390,10 @@
        curFile->buf_ptr = ptr;
        curFile->buf_freeIt = ptr;
        curFile->buf_end = ptr == NULL ? NULL : ptr + len;
-       curFile->lineno = curFile->first_lineno;
-       if (ptr != NULL)
+       if (ptr != NULL) {
+               curFile->lineno = curFile->first_lineno;
                return true;    /* Iterate again */
+       }
 
        /*
         * Ensure the makefile (or .for loop) didn't have mismatched
diff -r 175d219760fe -r 567607d991bf usr.bin/make/unit-tests/directive-for-generating-endif.exp
--- a/usr.bin/make/unit-tests/directive-for-generating-endif.exp        Sat Jan 01 22:01:18 2022 +0000
+++ b/usr.bin/make/unit-tests/directive-for-generating-endif.exp        Sun Jan 02 00:07:20 2022 +0000
@@ -1,7 +1,7 @@
 make: "directive-for-generating-endif.mk" line 21: if-less endif
 make: "directive-for-generating-endif.mk" line 21: if-less endif
 make: "directive-for-generating-endif.mk" line 21: if-less endif
-make: "directive-for-generating-endif.mk" line 0: 3 open conditionals
+make: "directive-for-generating-endif.mk" line 26: 3 open conditionals
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1



Home | Main Index | Thread Index | Old Index