Module Name: src
Committed By: rillig
Date: Sun Oct 25 16:15:48 UTC 2020
Modified Files:
src/usr.bin/make: for.c
src/usr.bin/make/unit-tests: forloop.exp
Log Message:
make(1): use complete words in error message for .for loop
To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/make/for.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/forloop.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/for.c
diff -u src/usr.bin/make/for.c:1.106 src/usr.bin/make/for.c:1.107
--- src/usr.bin/make/for.c:1.106 Sun Oct 25 16:14:08 2020
+++ src/usr.bin/make/for.c Sun Oct 25 16:15:48 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: for.c,v 1.106 2020/10/25 16:14:08 rillig Exp $ */
+/* $NetBSD: for.c,v 1.107 2020/10/25 16:15:48 rillig Exp $ */
/*
* Copyright (c) 1992, The Regents of the University of California.
@@ -60,7 +60,7 @@
#include "make.h"
/* "@(#)for.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: for.c,v 1.106 2020/10/25 16:14:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.107 2020/10/25 16:15:48 rillig Exp $");
/* The .for loop substitutes the items as ${:U<value>...}, which means
* that characters that break this syntax must be backslash-escaped. */
@@ -260,7 +260,7 @@ For_Eval(const char *line)
nitems % (nvars = new_for->vars.len)) {
Parse_Error(PARSE_FATAL,
"Wrong number of words (%zu) in .for substitution list"
- " with %zu vars", nitems, nvars);
+ " with %zu variables", nitems, nvars);
/*
* Return 'success' so that the body of the .for loop is
* accumulated.
Index: src/usr.bin/make/unit-tests/forloop.exp
diff -u src/usr.bin/make/unit-tests/forloop.exp:1.2 src/usr.bin/make/unit-tests/forloop.exp:1.3
--- src/usr.bin/make/unit-tests/forloop.exp:1.2 Fri May 1 16:29:34 2020
+++ src/usr.bin/make/unit-tests/forloop.exp Sun Oct 25 16:15:48 2020
@@ -13,7 +13,7 @@ a=four b="five"
a=ONE b="TWO AND THREE"
a=FOUR b="FIVE"
We expect an error next:
-make: "forloop.mk" line 46: Wrong number of words (9) in .for substitution list with 2 vars
+make: "forloop.mk" line 46: Wrong number of words (9) in .for substitution list with 2 variables
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
OK