diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-01-27 13:02:18 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-01-27 13:02:18 +0100 |
commit | b664f740d90880560ce46b11f766625341342e80 (patch) | |
tree | 6a85f939b21e1d2c531cf02ce6e6a22c1e954425 | |
parent | bf2f2229bb108a7bdd39326eb4e886e2f47df960 (diff) | |
download | busybox-w32-b664f740d90880560ce46b11f766625341342e80.tar.gz busybox-w32-b664f740d90880560ce46b11f766625341342e80.tar.bz2 busybox-w32-b664f740d90880560ce46b11f766625341342e80.zip |
libbb: open_zipped() should not fail on non-compressed files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libarchive/open_transformer.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c index 1aeba13bc..27854af21 100644 --- a/archival/libarchive/open_transformer.c +++ b/archival/libarchive/open_transformer.c | |||
@@ -200,7 +200,16 @@ int FAST_FUNC open_zipped(const char *fname) | |||
200 | || (ENABLE_FEATURE_SEAMLESS_BZ2) | 200 | || (ENABLE_FEATURE_SEAMLESS_BZ2) |
201 | || (ENABLE_FEATURE_SEAMLESS_XZ) | 201 | || (ENABLE_FEATURE_SEAMLESS_XZ) |
202 | ) { | 202 | ) { |
203 | setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1); | 203 | /* |
204 | * Do we want to fail_if_not_detected? | ||
205 | * In most cases, no: think "insmod non_compressed_module". | ||
206 | * A case which would like to fail is "zcat uncompressed_file": | ||
207 | * otherwise, it happily outputs uncompressed_file as-is, | ||
208 | * which is, strictly speaking, not what is expected. | ||
209 | * If this ever becomes a problem, we can add | ||
210 | * fail_if_not_detected bool argument to open_zipped(). | ||
211 | */ | ||
212 | setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 0); | ||
204 | } | 213 | } |
205 | 214 | ||
206 | return fd; | 215 | return fd; |