diff options
author | ru <ru@FreeBSD.org> | 2002-11-28 12:47:56 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-11-28 12:47:56 +0000 |
commit | d2aa2f14adccf0135fa00b1ca3b620b1bafa011e (patch) | |
tree | 857df806824e4d1f11282ca7502c9e223c2a6917 /usr.bin/make/parse.c | |
parent | b8dad5d242017f8252e395314aed513516be3306 (diff) | |
download | FreeBSD-src-d2aa2f14adccf0135fa00b1ca3b620b1bafa011e.zip FreeBSD-src-d2aa2f14adccf0135fa00b1ca3b620b1bafa011e.tar.gz |
Finish the fix in revision 1.39 -- make(1)'s behavior is now
"greedy" with respect to finding the dependency operators.
Approved by: re
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r-- | usr.bin/make/parse.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 1e6c641..0873f6d 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -729,14 +729,15 @@ ParseDoDependency (char *line) } else if (*cp == '!' || *cp == ':') { /* * We don't want to end a word on ':' or '!' if there is a - * better match later on in the string. By "better" I mean - * one that is followed by whitespace. This allows the user - * to have targets like: + * better match later on in the string (greedy matching). + * This allows the user to have targets like: * fie::fi:fo: fum - * where "fie::fi:fo" is the target. In real life this is used - * for perl5 library man pages where "::" separates an object - * from its class. Ie: "File::Spec::Unix". This behaviour - * is also consistent with other versions of make. + * foo::bar: + * where "fie::fi:fo" and "foo::bar" are the targets. In + * real life this is used for perl5 library man pages where + * "::" separates an object from its class. + * Ie: "File::Spec::Unix". This behaviour is also consistent + * with other versions of make. */ char *p = cp + 1; @@ -747,11 +748,7 @@ ParseDoDependency (char *line) if (*p == '\0' || isspace(*p)) break; - do { - p += strcspn(p, "!:"); - if (*p == '\0') - break; - } while (!isspace(*++p)); + p += strcspn(p, "!:"); /* No better match later on... */ if (*p == '\0') |