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 error message when regcomp fails
details: https://anonhg.NetBSD.org/src/rev/53d4caa37ad4
branches: trunk
changeset: 1012542:53d4caa37ad4
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Aug 01 18:14:08 2020 +0000
description:
make(1): fix error message when regcomp fails
If regcomp fails, it's not the regex substitution that is erroneous, but
the regex compilation.
diffstat:
usr.bin/make/unit-tests/Makefile | 6 +++---
usr.bin/make/unit-tests/modmisc.exp | 4 ++--
usr.bin/make/var.c | 8 ++++----
3 files changed, 9 insertions(+), 9 deletions(-)
diffs (76 lines):
diff -r bcea47c06eaf -r 53d4caa37ad4 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Sat Aug 01 18:02:37 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Sat Aug 01 18:14:08 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.79 2020/08/01 15:28:28 rillig Exp $
+# $NetBSD: Makefile,v 1.80 2020/08/01 18:14:08 rillig Exp $
#
# Unit tests for make(1)
#
@@ -98,8 +98,8 @@
FLAGS.vardebug= -k -dv FROM_CMDLINE=
# Some tests need extra post-processing.
-SED_CMDS.moderrs+= -e 's,\(substitution error:\).*,\1 (details omitted),'
-SED_CMDS.modmisc+= -e 's,\(substitution error:\).*,\1 (details omitted),'
+SED_CMDS.moderrs+= -e 's,\(Regex compilation error:\).*,\1 (details omitted),'
+SED_CMDS.modmisc+= -e 's,\(Regex compilation error:\).*,\1 (details omitted),'
SED_CMDS.varmod-edge+= -e 's, line [0-9]*:, line omitted:,'
SED_CMDS.varshell+= -e 's,^[a-z]*sh: ,,'
SED_CMDS.varshell+= -e '/command/s,No such.*,not found,'
diff -r bcea47c06eaf -r 53d4caa37ad4 usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp Sat Aug 01 18:02:37 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp Sat Aug 01 18:14:08 2020 +0000
@@ -31,7 +31,7 @@
:a b b c:
:a b b c:
: b c:
-make: RE substitution error: (details omitted)
+make: Regex compilation error: (details omitted)
:C,word,____,:Q}:
:a c:
:x__ 3 x__ 3:
@@ -75,7 +75,7 @@
mod-regex-limits:22-missing:1 6
mod-regex-limits:22-ok:1 33 556
mod-regex-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest
-make: RE substitution error: (details omitted)
+make: Regex compilation error: (details omitted)
mod-regex-errors:
mod-assign: first=1.
mod-assign: last=3.
diff -r bcea47c06eaf -r 53d4caa37ad4 usr.bin/make/var.c
--- a/usr.bin/make/var.c Sat Aug 01 18:02:37 2020 +0000
+++ b/usr.bin/make/var.c Sat Aug 01 18:14:08 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.384 2020/08/01 18:02:37 rillig Exp $ */
+/* $NetBSD: var.c,v 1.385 2020/08/01 18:14:08 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.384 2020/08/01 18:02:37 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.385 2020/08/01 18:14:08 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.384 2020/08/01 18:02:37 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.385 2020/08/01 18:14:08 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -2476,7 +2476,7 @@
int error = regcomp(&args.re, re, REG_EXTENDED);
free(re);
if (error) {
- VarREError(error, &args.re, "RE substitution error");
+ VarREError(error, &args.re, "Regex compilation error");
free(args.replace);
return AMR_CLEANUP;
}
Home |
Main Index |
Thread Index |
Old Index