diff options
| author | SASAKI Suguru <suguru@sonik.org> | 2013-08-15 12:19:29 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-08-15 12:19:29 +0200 |
| commit | 73fbe9dc86df6c7db425c2c3939ff98c8c44974e (patch) | |
| tree | b8b04f171828a93d1233bc82e175aa10cb514d35 | |
| parent | fc364ba9e3e39bc8d75016a9bf66e4bbbb5a1c87 (diff) | |
| download | busybox-w32-73fbe9dc86df6c7db425c2c3939ff98c8c44974e.tar.gz busybox-w32-73fbe9dc86df6c7db425c2c3939ff98c8c44974e.tar.bz2 busybox-w32-73fbe9dc86df6c7db425c2c3939ff98c8c44974e.zip | |
tar: fix tar -T to add entries in the exact order as the input list
This fixes tar to order files in tarball correctly in this case:
$ touch 1 2 3; echo -e '1\n2\n3' | tar -T- -c | tar t
1
2
3
Signed-off-by: SASAKI Suguru <suguru@sonik.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | archival/tar.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/archival/tar.c b/archival/tar.c index c0ceff589..3cd033be3 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
| @@ -679,14 +679,12 @@ static llist_t *append_file_list_to_list(llist_t *list) | |||
| 679 | char *cp = last_char_is(line, '/'); | 679 | char *cp = last_char_is(line, '/'); |
| 680 | if (cp > line) | 680 | if (cp > line) |
| 681 | *cp = '\0'; | 681 | *cp = '\0'; |
| 682 | llist_add_to(&newlist, line); | 682 | llist_add_to_end(&newlist, line); |
| 683 | } | 683 | } |
| 684 | fclose(src_stream); | 684 | fclose(src_stream); |
| 685 | } | 685 | } |
| 686 | return newlist; | 686 | return newlist; |
| 687 | } | 687 | } |
| 688 | #else | ||
| 689 | # define append_file_list_to_list(x) 0 | ||
| 690 | #endif | 688 | #endif |
| 691 | 689 | ||
| 692 | //usage:#define tar_trivial_usage | 690 | //usage:#define tar_trivial_usage |
