diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2001-10-13 06:53:34 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2001-10-13 06:53:34 +0000 |
commit | 527880e5cf0a76a53239bfc1da938db5b0d83b36 (patch) | |
tree | 234e65e061c643cad23a67aa7b90c106bd8e197a /libbb | |
parent | b5937d3eea72db7638060f0a612dfad1fc6b96cd (diff) | |
download | busybox-527880e5cf0a76a53239bfc1da938db5b0d83b36.tar.gz |
match exclude/include names with trailing '/'
Diffstat (limited to 'libbb')
-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 @@ #include <stdio.h> #include <errno.h> +#include <fnmatch.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -242,7 +243,7 @@ char *unarchive(FILE *src_stream, FILE *out_stream, file_header_t *(*get_headers if (extract_names != NULL) { int found_flag = FALSE; for(i = 0; extract_names[i] != 0; i++) { - if (fnmatch(extract_names[i], file_entry->name, 0) == 0) { + if (fnmatch(extract_names[i], file_entry->name, FNM_LEADING_DIR) == 0) { found_flag = TRUE; break; } @@ -506,8 +507,8 @@ file_header_t *get_header_tar(FILE *tar_stream) } formated; } tar; file_header_t *tar_entry = NULL; - long i; long sum = 0; + long i; if (archive_offset % 512 != 0) { seek_sub_file(tar_stream, 512 - (archive_offset % 512)); |