diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2002-11-28 12:47:56 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2002-11-28 12:47:56 +0000 |
commit | 43b92fef626c219f759af893429c2b275993c19a (patch) | |
tree | 857df806824e4d1f11282ca7502c9e223c2a6917 | |
parent | d5216a4fb72b3463bb145d6efbf0c107e6836c62 (diff) | |
download | src-43b92fef626c219f759af893429c2b275993c19a.tar.gz src-43b92fef626c219f759af893429c2b275993c19a.zip |
Finish the fix in revision 1.39 -- make(1)'s behavior is now
"greedy" with respect to finding the dependency operators.
Approved by: re
Notes
Notes:
svn path=/head/; revision=107373
-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 1e6c641ffc5c..0873f6d9f25a 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') |