summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-07-31 20:02:44 +0000
committerrillig <rillig@NetBSD.org>2020-07-31 20:02:44 +0000
commit87edaae69abea4edbc546b12ef968a3ffe4c8a24 (patch)
tree42d23443cbc2bdb8400c2e214201064f2542a0fd
parent63ceb644fd956c32f45446d051396b3acee47c64 (diff)
make(1): fix regression and add test for empty brace expansion
This had been broken in r1.80 of dir.c, a few minutes ago.
-rw-r--r--usr.bin/make/dir.c8
-rw-r--r--usr.bin/make/unit-tests/dir.exp4
-rw-r--r--usr.bin/make/unit-tests/dir.mk7
3 files changed, 14 insertions, 5 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c
index d4722a14a8d..eb5d052e02b 100644
--- a/usr.bin/make/dir.c
+++ b/usr.bin/make/dir.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -752,7 +752,7 @@ DirExpandCurly(const char *word, const char *brace, Lst path, Lst expansions)
/* Split the middle into pieces, separated by commas. */
const char *piece = middle;
- while (piece < middle_end) {
+ while (piece < middle_end + 1) {
const char *piece_end = separator_comma(piece);
size_t piece_len = (size_t)(piece_end - piece);
diff --git a/usr.bin/make/unit-tests/dir.exp b/usr.bin/make/unit-tests/dir.exp
index 931ae0446c7..efd861fe176 100644
--- a/usr.bin/make/unit-tests/dir.exp
+++ b/usr.bin/make/unit-tests/dir.exp
@@ -6,4 +6,8 @@
13
14
15
+pre-patch
+pre-configure
+patch
+configure
exit status 0
diff --git a/usr.bin/make/unit-tests/dir.mk b/usr.bin/make/unit-tests/dir.mk
index 108368cf007..5e314e7c97e 100644
--- a/usr.bin/make/unit-tests/dir.mk
+++ b/usr.bin/make/unit-tests/dir.mk
@@ -1,4 +1,4 @@
-# $NetBSD: dir.mk,v 1.1 2020/07/31 16:42:51 rillig Exp $
+# $NetBSD: dir.mk,v 1.2 2020/07/31 20:02:44 rillig Exp $
#
# Tests for dir.c.
@@ -31,3 +31,8 @@ fourteen:
@echo 14
fifteen:
@echo 15
+
+all: {pre-,}{patch,configure}
+
+pre-patch patch pre-configure configure:
+ @echo $@