aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-08-22 11:50:31 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-08-22 11:50:31 +0000
commit75762705a3a8db5e82e36401babac36fa976aca2 (patch)
tree3e27d1c3b1e47a76c4d04fdbc5aa95a678607c5f
parent419eed7501f97d1fe091ddbddc57e5131aa39487 (diff)
downloadbusybox-w32-75762705a3a8db5e82e36401babac36fa976aca2.tar.gz
busybox-w32-75762705a3a8db5e82e36401babac36fa976aca2.tar.bz2
busybox-w32-75762705a3a8db5e82e36401babac36fa976aca2.zip
Honour the USTAR prefix field, this enables a 155 byte path length plus the normal 100 byte filename.
The catch is gnu tar cannot create archives that use the prefix field, you need to use s-tar.
-rw-r--r--archival/libunarchive/get_header_tar.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 07b9ae36f..668fa5a2c 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -71,7 +71,7 @@ file_header_t *get_header_tar(FILE *tar_stream)
71 } 71 }
72 72
73 /* If there is no filename its an empty header, skip it */ 73 /* If there is no filename its an empty header, skip it */
74 if (xstrlen(tar.formated.name) == 0) { 74 if (tar.formated.name[0] == 0) {
75 return(NULL); 75 return(NULL);
76 } 76 }
77 77
@@ -90,7 +90,11 @@ file_header_t *get_header_tar(FILE *tar_stream)
90 90
91 /* convert to type'ed variables */ 91 /* convert to type'ed variables */
92 tar_entry = xcalloc(1, sizeof(file_header_t)); 92 tar_entry = xcalloc(1, sizeof(file_header_t));
93 tar_entry->name = xstrdup(tar.formated.name); 93 if (tar.formated.prefix[0] == 0) {
94 tar_entry->name = xstrdup(tar.formated.name);
95 } else {
96 tar_entry->name = concat_path_file(tar.formated.prefix, tar.formated.name);
97 }
94 98
95 tar_entry->mode = strtol(tar.formated.mode, NULL, 8); 99 tar_entry->mode = strtol(tar.formated.mode, NULL, 8);
96#ifdef CONFIG_FEATURE_TAR_OLD_FORMAT 100#ifdef CONFIG_FEATURE_TAR_OLD_FORMAT