Both "foo/" and "foo" should match "foo/bar", so strip

trailing '/' characters on include patterns for extraction.

Pointed out by: games/quakeforge port (thanks to Kris!)
This commit is contained in:
kientzle 2004-06-02 07:23:54 +00:00
parent 3bbd46d6d9
commit 9c86db05ef

View File

@ -102,6 +102,9 @@ add_pattern(struct bsdtar *bsdtar, struct match **list, const char *pattern)
if (pattern[0] == '/')
pattern++;
strcpy(match->pattern, pattern);
/* Both "foo/" and "foo" should match "foo/bar". */
if (match->pattern[strlen(match->pattern)-1] == '/')
match->pattern[strlen(match->pattern)-1] = '\0';
match->next = *list;
*list = match;
match->matches = 0;