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 bug in :E modifier, introduced in ...
details: https://anonhg.NetBSD.org/src/rev/dfdd5c2f0312
branches: trunk
changeset: 935485:dfdd5c2f0312
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Jul 03 18:41:50 2020 +0000
description:
make(1): fix bug in :E modifier, introduced in r1.239 today
That case was not covered by the tests before.
diffstat:
usr.bin/make/unit-tests/modmisc.exp | 8 ++++----
usr.bin/make/unit-tests/modmisc.mk | 12 ++++++------
usr.bin/make/var.c | 10 +++++-----
3 files changed, 15 insertions(+), 15 deletions(-)
diffs (84 lines):
diff -r 00fdf938a9e9 -r dfdd5c2f0312 usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp Fri Jul 03 17:48:47 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp Fri Jul 03 18:41:50 2020 +0000
@@ -7,8 +7,8 @@
paths=/bin /tmp / /no/such/dir /opt/xbin
PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
The answer is 42
-head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d
-tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file
-suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file
-root of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b/c def archive.tar conf
+head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d'
+tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file'
+suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file'
+root of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b/c def archive.tar conf'
exit status 0
diff -r 00fdf938a9e9 -r dfdd5c2f0312 usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk Fri Jul 03 17:48:47 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk Fri Jul 03 18:41:50 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.5 2020/07/03 15:41:37 rillig Exp $
+# $Id: modmisc.mk,v 1.6 2020/07/03 18:41:50 rillig Exp $
#
# miscellaneous modifier tests
@@ -37,9 +37,9 @@
@echo "paths=${paths}"
@echo "PATHS=${paths:tu}"
-PATHNAMES= a/b/c def archive.tar.gz conf.d/file
+PATHNAMES= a/b/c def a.b.c a.b/c a a.a .gitignore a a.a
mod-HTE:
- @echo "head of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q}
- @echo "tail of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q}
- @echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q}
- @echo "root of '"${PATHNAMES:Q}"' is '"${PATHNAMES:R:Q}
+ @echo "dirname of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q}"'"
+ @echo "basename of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q}"'"
+ @echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q}"'"
+ @echo "root of '"${PATHNAMES:Q}"' is '"${PATHNAMES:R:Q}"'"
diff -r 00fdf938a9e9 -r dfdd5c2f0312 usr.bin/make/var.c
--- a/usr.bin/make/var.c Fri Jul 03 17:48:47 2020 +0000
+++ b/usr.bin/make/var.c Fri Jul 03 18:41:50 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $ */
+/* $NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.242 2020/07/03 17:48:47 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 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.242 2020/07/03 17:48:47 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.243 2020/07/03 18:41:50 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1202,7 +1202,7 @@
return TRUE;
}
-/* Add the filename suffix of the given word to the buffer. */
+/* Add the filename suffix of the given word to the buffer, if it exists. */
static Boolean
VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer *buf,
@@ -1210,7 +1210,7 @@
{
const char *dot = strrchr(word, '.');
if (dot == NULL)
- return FALSE;
+ return addSpace;
if (addSpace && vpstate->varSpace)
Buf_AddByte(buf, vpstate->varSpace);
Home |
Main Index |
Thread Index |
Old Index