summaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-09-03 14:04:33 +0000
committerDenis Vlasenko2006-09-03 14:04:33 +0000
commit314908da9e156e3100275598dde6848da038d65d (patch)
treed12f6ab92f2435ac599eb1f45b7bfeb8d7aafc1f /archival/tar.c
parent65113e8d97c62b6aed560ac73961c8a9020c1568 (diff)
downloadbusybox-314908da9e156e3100275598dde6848da038d65d.zip
busybox-314908da9e156e3100275598dde6848da038d65d.tar.gz
tar: revert older fix (non-portable), added new one.
testsuite tar-extracts-all-subdirs now passes.
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 160731e..0b5720f 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -545,8 +545,12 @@ static llist_t *append_file_list_to_list(llist_t *list)
tmp = cur;
cur = cur->link;
free(tmp);
- while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL)
+ while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
+ char *filename_ptr = last_char_is(line, '/');
+ if (filename_ptr > line)
+ *filename_ptr = '\0';
llist_add_to(&newlist, line);
+ }
fclose(src_stream);
}
return newlist;