Module Name: src
Committed By: rillig
Date: Fri Sep 25 23:30:16 UTC 2020
Modified Files:
src/usr.bin/make: parse.c
src/usr.bin/make/unit-tests: dep-colon-bug-cross-file.exp
dep-colon-bug-cross-file.mk opt-debug-graph1.exp
Log Message:
make(1): fix missing check for duplicate commands in Parse_File
To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp \
src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-debug-graph1.exp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.327 src/usr.bin/make/parse.c:1.328
--- src/usr.bin/make/parse.c:1.327 Fri Sep 25 21:13:44 2020
+++ src/usr.bin/make/parse.c Fri Sep 25 23:30:16 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.327 2020/09/25 21:13:44 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.328 2020/09/25 23:30:16 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.327 2020/09/25 21:13:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.328 2020/09/25 23:30:16 rillig Exp $");
/* types and constants */
@@ -3129,6 +3129,8 @@ Parse_File(const char *name, int fd)
*/
} while (ParseEOF() == CONTINUE);
+ ParseFinishLine();
+
if (fatals) {
(void)fflush(stdout);
(void)fprintf(stderr,
Index: src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp
diff -u src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp:1.1 src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp:1.2
--- src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp:1.1 Fri Sep 25 23:24:49 2020
+++ src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp Fri Sep 25 23:30:16 2020
@@ -1,3 +1,4 @@
+make: "dep-colon-bug-cross-file.mk" line 31: warning: duplicate script for target "all" ignored
+make: "dep-colon-bug-cross-file.mk" line 40: warning: using previous script for "all" defined here
: pass 1
-: pass 2
exit status 0
Index: src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk
diff -u src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk:1.1 src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk:1.2
--- src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk:1.1 Fri Sep 25 23:24:49 2020
+++ src/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk Fri Sep 25 23:30:16 2020
@@ -1,4 +1,4 @@
-# $NetBSD: dep-colon-bug-cross-file.mk,v 1.1 2020/09/25 23:24:49 rillig Exp $
+# $NetBSD: dep-colon-bug-cross-file.mk,v 1.2 2020/09/25 23:30:16 rillig Exp $
#
# Until 2020-09-25, the very last dependency group of a top-level makefile
# was not finished properly. This made it possible to add further commands
@@ -14,8 +14,6 @@
# which is still the one from pass 1, which means it is possible to even
# cross file boundaries.
#
-# TODO: Finish the file properly in Parse_File.
-#
# Oops, even worse. Running this test in a make from 2020-09-25 or earlier
# on NetBSD 8.0 x86_64 with MALLOC_OPTIONS=JA produces this or a similar
# output:
Index: src/usr.bin/make/unit-tests/opt-debug-graph1.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.3 src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.4
--- src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.3 Sat Sep 5 06:46:12 2020
+++ src/usr.bin/make/unit-tests/opt-debug-graph1.exp Fri Sep 25 23:30:16 2020
@@ -1,5 +1,5 @@
#*** Input graph:
-# all, made UNMADE, type OP_DEPENDS, flags none
+# all, made UNMADE, type OP_DEPENDS|OP_HAS_COMMANDS, flags none
# made-target, made UNMADE, type OP_DEPENDS, flags none
# made-target-no-sources, made UNMADE, type OP_DEPENDS, flags none
# made-source, made UNMADE, type OP_DEPENDS, flags none