diff options
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/dir.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 1431687..38754e1 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -296,17 +296,33 @@ Dir_HasWildcards (name) char *name; /* name to check */ { char *cp; + int wild = 0, brace = 0, bracket = 0; for (cp = name; *cp; cp++) { switch(*cp) { case '{': + brace++; + wild = 1; + break; + case '}': + brace--; + break; case '[': + bracket++; + wild = 1; + break; + case ']': + bracket--; + break; case '?': case '*': - return (TRUE); + wild = 1; + break; + default: + break; } } - return (FALSE); + return wild && bracket == 0 && brace == 0; } /*- |