summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-08-17 19:43:45 +0000
committerkientzle <kientzle@FreeBSD.org>2008-08-17 19:43:45 +0000
commit7fc341305a3e341fca7f202fc1219358f8d9dbbd (patch)
tree6db2cea47d02e96c780ea4c1a99040439b464a2a
parentddd418aba15c92f7477755e00f6496a469c500ba (diff)
downloadFreeBSD-src-7fc341305a3e341fca7f202fc1219358f8d9dbbd.zip
FreeBSD-src-7fc341305a3e341fca7f202fc1219358f8d9dbbd.tar.gz
Don't strip a leading '/' from a pattern to be matched.
This aligns the pattern-matching behavior with GNU tar and restores the behavior of bsdtar prior to FreeBSD 6.3. PR: bin/117909 MFC after: 3 days
-rw-r--r--usr.bin/tar/matching.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/usr.bin/tar/matching.c b/usr.bin/tar/matching.c
index 782f761..406564a 100644
--- a/usr.bin/tar/matching.c
+++ b/usr.bin/tar/matching.c
@@ -118,8 +118,6 @@ add_pattern(struct bsdtar *bsdtar, struct match **list, const char *pattern)
match = malloc(sizeof(*match) + strlen(pattern) + 1);
if (match == NULL)
bsdtar_errc(bsdtar, 1, errno, "Out of memory");
- if (pattern[0] == '/')
- pattern++;
strcpy(match->pattern, pattern);
/* Both "foo/" and "foo" should match "foo/bar". */
if (match->pattern[strlen(match->pattern)-1] == '/')
OpenPOWER on IntegriCloud