diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-11-20 13:47:06 +0300 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-11-20 13:47:06 +0300 |
commit | e857122c97b934a00252889a978db69d4e774df7 (patch) | |
tree | 896833c6053b6159ea1d83f4eac19145a0e67652 /archival | |
parent | d9c8ab40a485aa8a7fae92a5d2bbada0e7513ef3 (diff) |
Fix tar-handles-nested-exclude testcase
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 8 | ||||
-rw-r--r-- | archival/tar.c | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index 5354af8d7..d55189f42 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c @@ -106,6 +106,14 @@ extern char get_header_tar(archive_handle_t *archive_handle) file_header->name = concat_path_file(tar.formated.prefix, tar.formated.name); } + { /* Strip trailing '/' in directories */ + char *tmp = last_char_is(file_header->name, '/'); + if (tmp) { + *tmp = '\0'; + } + } + + file_header->mode = strtol(tar.formated.mode, NULL, 8); file_header->uid = strtol(tar.formated.uid, NULL, 8); file_header->gid = strtol(tar.formated.gid, NULL, 8); diff --git a/archival/tar.c b/archival/tar.c index c8a2bd385..b3fa447f2 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -731,6 +731,11 @@ int tar_main(int argc, char **argv) /* Setup an array of filenames to work with */ /* TODO: This is the same as in ar, seperate function ? */ while (optind < argc) { + char *filename_ptr; + filename_ptr = last_char_is(argv[optind], '/'); + if (filename_ptr) { + *filename_ptr = '\0'; + } tar_handle->accept = llist_add_to(tar_handle->accept, argv[optind]); optind++; } |