diff options
| author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-10-13 06:53:34 +0000 |
|---|---|---|
| committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-10-13 06:53:34 +0000 |
| commit | d704dc661acf0cb720439429a49609f73e33178b (patch) | |
| tree | 234e65e061c643cad23a67aa7b90c106bd8e197a | |
| parent | 23e2f0851244190bb6a6a9d0734b9406bc8f3211 (diff) | |
| download | busybox-w32-d704dc661acf0cb720439429a49609f73e33178b.tar.gz busybox-w32-d704dc661acf0cb720439429a49609f73e33178b.tar.bz2 busybox-w32-d704dc661acf0cb720439429a49609f73e33178b.zip | |
match exclude/include names with trailing '/'
git-svn-id: svn://busybox.net/trunk/busybox@3513 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | libbb/unarchive.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c index 3bf79d646..37ab67aff 100644 --- a/libbb/unarchive.c +++ b/libbb/unarchive.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | #include <stdio.h> | 22 | #include <stdio.h> |
| 23 | #include <errno.h> | 23 | #include <errno.h> |
| 24 | #include <fnmatch.h> | ||
| 24 | #include <stdlib.h> | 25 | #include <stdlib.h> |
| 25 | #include <string.h> | 26 | #include <string.h> |
| 26 | #include <unistd.h> | 27 | #include <unistd.h> |
| @@ -242,7 +243,7 @@ char *unarchive(FILE *src_stream, FILE *out_stream, file_header_t *(*get_headers | |||
| 242 | if (extract_names != NULL) { | 243 | if (extract_names != NULL) { |
| 243 | int found_flag = FALSE; | 244 | int found_flag = FALSE; |
| 244 | for(i = 0; extract_names[i] != 0; i++) { | 245 | for(i = 0; extract_names[i] != 0; i++) { |
| 245 | if (fnmatch(extract_names[i], file_entry->name, 0) == 0) { | 246 | if (fnmatch(extract_names[i], file_entry->name, FNM_LEADING_DIR) == 0) { |
| 246 | found_flag = TRUE; | 247 | found_flag = TRUE; |
| 247 | break; | 248 | break; |
| 248 | } | 249 | } |
| @@ -506,8 +507,8 @@ file_header_t *get_header_tar(FILE *tar_stream) | |||
| 506 | } formated; | 507 | } formated; |
| 507 | } tar; | 508 | } tar; |
| 508 | file_header_t *tar_entry = NULL; | 509 | file_header_t *tar_entry = NULL; |
| 509 | long i; | ||
| 510 | long sum = 0; | 510 | long sum = 0; |
| 511 | long i; | ||
| 511 | 512 | ||
| 512 | if (archive_offset % 512 != 0) { | 513 | if (archive_offset % 512 != 0) { |
| 513 | seek_sub_file(tar_stream, 512 - (archive_offset % 512)); | 514 | seek_sub_file(tar_stream, 512 - (archive_offset % 512)); |
