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): remove redundant code branch in SysVMatch
details: https://anonhg.NetBSD.org/src/rev/0f52796b0e4e
branches: trunk
changeset: 945473:0f52796b0e4e
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Oct 31 09:03:36 2020 +0000
description:
make(1): remove redundant code branch in SysVMatch
The general code path of parsing :from=to achieves the same effect.
diffstat:
usr.bin/make/unit-tests/varmod-sysv.mk | 7 ++++++-
usr.bin/make/var.c | 9 ++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diffs (51 lines):
diff -r 29a60478a476 -r 0f52796b0e4e usr.bin/make/unit-tests/varmod-sysv.mk
--- a/usr.bin/make/unit-tests/varmod-sysv.mk Sat Oct 31 08:40:54 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-sysv.mk Sat Oct 31 09:03:36 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-sysv.mk,v 1.6 2020/10/31 08:31:37 rillig Exp $
+# $NetBSD: varmod-sysv.mk,v 1.7 2020/10/31 09:03:36 rillig Exp $
#
# Tests for the ${VAR:from=to} variable modifier, which replaces the suffix
# "from" with "to". It can also use '%' as a wildcard.
@@ -60,6 +60,11 @@
. error
.endif
+# Each word gets the suffix "X" appended.
+.if ${one two:L:=X} != "oneX twoX"
+. error
+.endif
+
# The suffix "o" is replaced with "X".
.if ${one two:L:o=X} != "one twX"
. error
diff -r 29a60478a476 -r 0f52796b0e4e usr.bin/make/var.c
--- a/usr.bin/make/var.c Sat Oct 31 08:40:54 2020 +0000
+++ b/usr.bin/make/var.c Sat Oct 31 09:03:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.611 2020/10/31 08:40:54 rillig Exp $ */
+/* $NetBSD: var.c,v 1.612 2020/10/31 09:03:36 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.611 2020/10/31 08:40:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.612 2020/10/31 09:03:36 rillig Exp $");
#define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
#define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -1181,11 +1181,6 @@
const char *w_tail;
*out_hasPercent = FALSE;
- if (*p == '\0') { /* ${VAR:=suffix} */
- *out_match_len = strlen(w); /* Null pattern is the whole string */
- return w;
- }
-
percent = strchr(p, '%');
if (percent != NULL) { /* ${VAR:...%...=...} */
*out_hasPercent = TRUE;
Home |
Main Index |
Thread Index |
Old Index