File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ testing "-T newline" "$TAR -T input | LST" \
43
43
" -rw-rw-r-- root/sys 0 2009-02-13 23:31 file1\n-rw-rw-r-- root/sys 0 2009-02-13 23:31 file2\n" " file1\nfile2\n" " "
44
44
testing " -T null" " $TAR --null -T input | LST" \
45
45
" -rw-rw-r-- root/sys 0 2009-02-13 23:31 file1\n-rw-rw-r-- root/sys 0 2009-02-13 23:31 file2\n" " file1\0file2\0" " "
46
+ testing " empty -T creates empty tarball" " tar c | SUM 2" \
47
+ " da39a3ee5e6b4b0d3255bfef95601890afd80709\n" " " " "
46
48
47
49
# User "root" is UID 0 and group "sys" is GID 3 (on Linux, BSD, and Mac),
48
50
# inherited from Bell Labs Unix v7
Original file line number Diff line number Diff line change @@ -1045,7 +1045,7 @@ void tar_main(void)
1045
1045
1046
1046
// If include file list empty, don't create empty archive
1047
1047
if (FLAG (c )) {
1048
- if (!TT .incl ) error_exit ("empty archive" );
1048
+ if (!TT .incl && ! FLAG ( T ) ) error_exit ("empty archive" );
1049
1049
TT .fd = 1 ;
1050
1050
}
1051
1051
@@ -1194,7 +1194,7 @@ void tar_main(void)
1194
1194
close (TT .fd );
1195
1195
TT .fd = pipefd [0 ];
1196
1196
}
1197
- do {
1197
+ if ( dl ) do {
1198
1198
TT .warn = 1 ;
1199
1199
dirtree_flagread (dl -> data ,
1200
1200
DIRTREE_SYMFOLLOW * FLAG (h )|DIRTREE_BREADTH * (FLAG (sort )|FLAG (s )),
You can’t perform that action at this time.
0 commit comments