← Commit list

b664f740d

Denys Vlasenko
Denys Vlasenko
2014-01-27
SUCCESS Duration: 131s

Subject

libbb: open_zipped() should not fail on non-compressed files

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/libarchive/open_transformer.c+10 -1
@@ -200,7 +200,16 @@ int FAST_FUNC open_zipped(const char *fname)
|| (ENABLE_FEATURE_SEAMLESS_BZ2)
|| (ENABLE_FEATURE_SEAMLESS_XZ)
) {
- setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
+ /*
+ * Do we want to fail_if_not_detected?
+ * In most cases, no: think "insmod non_compressed_module".
+ * A case which would like to fail is "zcat uncompressed_file":
+ * otherwise, it happily outputs uncompressed_file as-is,
+ * which is, strictly speaking, not what is expected.
+ * If this ever becomes a problem, we can add
+ * fail_if_not_detected bool argument to open_zipped().
+ */
+ setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 0);
}
return fd;