mirror of
https://github.com/sheumann/hush.git
synced 2024-08-01 01:28:57 +00:00
match exclude/include names with trailing '/'
This commit is contained in:
parent
b5937d3eea
commit
527880e5cf
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.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) {
|
if (extract_names != NULL) {
|
||||||
int found_flag = FALSE;
|
int found_flag = FALSE;
|
||||||
for(i = 0; extract_names[i] != 0; i++) {
|
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;
|
found_flag = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -506,8 +507,8 @@ file_header_t *get_header_tar(FILE *tar_stream)
|
|||||||
} formated;
|
} formated;
|
||||||
} tar;
|
} tar;
|
||||||
file_header_t *tar_entry = NULL;
|
file_header_t *tar_entry = NULL;
|
||||||
long i;
|
|
||||||
long sum = 0;
|
long sum = 0;
|
||||||
|
long i;
|
||||||
|
|
||||||
if (archive_offset % 512 != 0) {
|
if (archive_offset % 512 != 0) {
|
||||||
seek_sub_file(tar_stream, 512 - (archive_offset % 512));
|
seek_sub_file(tar_stream, 512 - (archive_offset % 512));
|
||||||
|
Loading…
Reference in New Issue
Block a user