aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-10-13 06:53:34 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-10-13 06:53:34 +0000
commit527880e5cf0a76a53239bfc1da938db5b0d83b36 (patch)
tree234e65e061c643cad23a67aa7b90c106bd8e197a
parentb5937d3eea72db7638060f0a612dfad1fc6b96cd (diff)
downloadbusybox-w32-527880e5cf0a76a53239bfc1da938db5b0d83b36.tar.gz
busybox-w32-527880e5cf0a76a53239bfc1da938db5b0d83b36.tar.bz2
busybox-w32-527880e5cf0a76a53239bfc1da938db5b0d83b36.zip
match exclude/include names with trailing '/'
-rw-r--r--libbb/unarchive.c5
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));