Fix test output when gzip is run with -tlv
When run with test, verbose and list we need to parse the file otherwise the test output is "NOT OK" even for the file is valid. Reviewed by: kevans, allanjude, imp Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34046
This commit is contained in:
parent
f0ec0fda01
commit
21c966a6b9
@ -1655,10 +1655,13 @@ file_uncompress(char *file, char *outfile, size_t outsize)
|
|||||||
case FT_XZ:
|
case FT_XZ:
|
||||||
if (lflag) {
|
if (lflag) {
|
||||||
size = unxz_len(fd);
|
size = unxz_len(fd);
|
||||||
print_list_out(in_size, size, file);
|
if (!tflag) {
|
||||||
return -1;
|
print_list_out(in_size, size, file);
|
||||||
}
|
close(fd);
|
||||||
size = unxz(fd, zfd, NULL, 0, NULL);
|
return -1;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
size = unxz(fd, zfd, NULL, 0, NULL);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1683,8 +1686,10 @@ file_uncompress(char *file, char *outfile, size_t outsize)
|
|||||||
default:
|
default:
|
||||||
if (lflag) {
|
if (lflag) {
|
||||||
print_list(fd, in_size, outfile, isb.st_mtime);
|
print_list(fd, in_size, outfile, isb.st_mtime);
|
||||||
close(fd);
|
if (!tflag) {
|
||||||
return -1; /* XXX */
|
close(fd);
|
||||||
|
return -1; /* XXX */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size = gz_uncompress(fd, zfd, NULL, 0, NULL, file);
|
size = gz_uncompress(fd, zfd, NULL, 0, NULL, file);
|
||||||
|
Loading…
Reference in New Issue
Block a user