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
This commit is contained in:
Juli Mallett 2002-05-05 19:04:58 +00:00
parent a9b736ad72
commit 417485c74a

View File

@ -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);