aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/libunarchive/get_header_tar.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 54c8f7665..b1a797a08 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -112,7 +112,7 @@ char get_header_tar(archive_handle_t *archive_handle)
112 archive_handle->offset += 512; 112 archive_handle->offset += 512;
113 113
114 /* If there is no filename its an empty header */ 114 /* If there is no filename its an empty header */
115 if (tar.name[0] == 0) { 115 if (tar.name[0] == 0 && tar.prefix[0] == 0) {
116 if (end) { 116 if (end) {
117 /* This is the second consecutive empty header! End of archive! 117 /* This is the second consecutive empty header! End of archive!
118 * Read until the end to empty the pipe from gz or bz2 118 * Read until the end to empty the pipe from gz or bz2
@@ -211,9 +211,12 @@ char get_header_tar(archive_handle_t *archive_handle)
211 /* getOctal trashes subsequent field, therefore we call it 211 /* getOctal trashes subsequent field, therefore we call it
212 * on fields in reverse order */ 212 * on fields in reverse order */
213 if (tar.devmajor[0]) { 213 if (tar.devmajor[0]) {
214 char t = tar.prefix[0];
215 /* we trash prefix[0] here, but we DO need it later! */
214 unsigned minor = GET_OCTAL(tar.devminor); 216 unsigned minor = GET_OCTAL(tar.devminor);
215 unsigned major = GET_OCTAL(tar.devmajor); 217 unsigned major = GET_OCTAL(tar.devmajor);
216 file_header->device = makedev(major, minor); 218 file_header->device = makedev(major, minor);
219 tar.prefix[0] = t;
217 } 220 }
218 file_header->link_target = NULL; 221 file_header->link_target = NULL;
219 if (!linkname && parse_names && tar.linkname[0]) { 222 if (!linkname && parse_names && tar.linkname[0]) {