summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-05-05 19:04:58 +0000
committerjmallett <jmallett@FreeBSD.org>2002-05-05 19:04:58 +0000
commit285791a69638a8c6cc6a9aa0bb65cf3441e78928 (patch)
tree21006cd681613d12ba5e555a6f05a571f6cec12b /usr.bin
parent62cedbf5fcf1db5d9c9b44842e4d98a9e8929b2b (diff)
downloadFreeBSD-src-285791a69638a8c6cc6a9aa0bb65cf3441e78928.zip
FreeBSD-src-285791a69638a8c6cc6a9aa0bb65cf3441e78928.tar.gz
Fix make(1) behaviour regarding SysV-style substitution when given a nil
left-hand-side. PR: bin/5297 Submitted by: "Matthew Emmerton" <matt@gsicomp.on.ca> MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/str.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c
index 4889ec9..097e312 100644
--- a/usr.bin/make/str.c
+++ b/usr.bin/make/str.c
@@ -417,6 +417,12 @@ Str_SYSVMatch(word, pattern, len)
char *w = word;
char *m;
+ if (*w == '\0') {
+ /* Zero-length word cannot be matched against */
+ *len = 0;
+ return NULL;
+ }
+
if (*p == '\0') {
/* Null pattern is the whole string */
*len = strlen(w);
OpenPOWER on IntegriCloud