Module Name:    src
Committed By:   rillig
Date:           Fri Jul 31 20:02:44 UTC 2020

Modified Files:
        src/usr.bin/make: dir.c
        src/usr.bin/make/unit-tests: dir.exp dir.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/make/dir.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dir.exp
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dir.mk

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/dir.c
diff -u src/usr.bin/make/dir.c:1.80 src/usr.bin/make/dir.c:1.81
--- src/usr.bin/make/dir.c:1.80	Fri Jul 31 19:50:44 2020
+++ src/usr.bin/make/dir.c	Fri Jul 31 20:02:44 2020
@@ -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 c
     /* 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);
 

Index: src/usr.bin/make/unit-tests/dir.exp
diff -u src/usr.bin/make/unit-tests/dir.exp:1.2 src/usr.bin/make/unit-tests/dir.exp:1.3
--- src/usr.bin/make/unit-tests/dir.exp:1.2	Fri Jul 31 19:06:33 2020
+++ src/usr.bin/make/unit-tests/dir.exp	Fri Jul 31 20:02:44 2020
@@ -6,4 +6,8 @@
 13
 14
 15
+pre-patch
+pre-configure
+patch
+configure
 exit status 0

Index: src/usr.bin/make/unit-tests/dir.mk
diff -u src/usr.bin/make/unit-tests/dir.mk:1.1 src/usr.bin/make/unit-tests/dir.mk:1.2
--- src/usr.bin/make/unit-tests/dir.mk:1.1	Fri Jul 31 16:42:51 2020
+++ src/usr.bin/make/unit-tests/dir.mk	Fri Jul 31 20:02:44 2020
@@ -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 $@

Reply via email to