<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Fixed thanks!<div class=""><br class=""></div><div class="">christos<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 19, 2022, at 8:40 AM, Vincent Mihalkovic <<a href="mailto:vmihalko@redhat.com" class="">vmihalko@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><p style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><defanged_div dir="ltr" class=""></defanged_div></p><p style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><defanged_div dir="ltr" class="">Hi, </defanged_div></p><p style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><p class=""><defanged_div class="">There was probably a misunderstanding. I sent an email: <a href="https://mailman.astron.com/pipermail/file/2022-September/000856.html" class="">https://mailman.astron.com/pipermail/file/2022-September/000856.html</a><span class="Apple-converted-space"> </span>with patch.</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">If I understand correctly this commit: <a href="https://github.com/file/file/commit/18f0474f698ef8f7247d61fc12a46c49dd7f7ed7" class="">https://github.com/file/file/commit/18f0474f698ef8f7247d61fc12a46c49dd7f7ed7</a><span class="Apple-converted-space"> </span>is a response to the mentioned email.</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">With your fix we now ignore any errors that might occur in gzip decompression. For example:</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">$ touch x y</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">$ zip two_empty_files x y</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""></defanged_div></p><p class=""><defanged_div class="">$ gzip -cd two_empty_files.zip</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""> gzip: two_empty_files.zip.zip has more than one entry--rest ignored</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">$ echo $?</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""> 2</defanged_div></p><defanged_div class=""><div class=""><br class="webkit-block-placeholder"></div><defanged_div class=""><p class=""><defanged_div class="">$ file -z two_empty_files.zip</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""> two_empty_files.zip: empty (Zip archive data, at least v1.0 to extract, compression method=store)</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">My patch (in attachment) was implementing the idea that the OK state is when no error occurred. With this patch, output is:</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">$ file -z two_empty_files.zip</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""> z.zip: ERROR:[gzip: Stdin has more than one entry--rest ignored] (Zip archive data, at least v1.0 to extract, compression method=store)</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">Amended patch in attachment.</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">best regards,<br class="">vincent mihalkovic</defanged_div></p><defanged_div class=""><div class=""><br class="webkit-block-placeholder"></div><defanged_div class=""><br class=""><p class=""><defanged_div class="gmail_quote"></defanged_div></p><p class=""><defanged_div dir="ltr" class="gmail_attr">On Tue, Sep 13, 2022 at 5:16 PM Vincent Mihalkovic <<a href="mailto:vmihalko@redhat.com" class="">vmihalko@redhat.com</a>> wrote:<br class=""></defanged_div></p><defanged_div class=""><blockquote class="gmail_quote" defanged_style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p class=""><defanged_div dir="ltr" class="">Hello, </defanged_div></p><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">reproducer from<span class="Apple-converted-space"> </span><a href="https://bugzilla.redhat.com/show_bug.cgi?id=2095828" target="_blank" class="">https://bugzilla.redhat.com/show_bug.cgi?id=2095828</a><span class="Apple-converted-space"> </span>is quite simple:<br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">$ touch emptyFile<br class="">$ zip emptyFileArchive emptyFile</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""> <span class="Apple-converted-space"> </span>adding: emptyFile (stored 0%)<br class="">$ file -z emptyFileArchive.zip</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">emptyFileArchive.zip: ERROR:[gzip: Read failed, No such file or directory] (Zip archive data, at least v1.0 to extract, compression method=store)</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">If we consider gzip flags "-cd"<span class="Apple-converted-space"> </span><a href="https://github.com/file/file/blob/master/src/compress.c#L134" target="_blank" class="">https://github.com/file/file/blob/master/src/compress.c#L134</a></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">-c: Write output on standard output;</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">-d: Decompress;</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">and run:</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">$ gzip -cd emptyFileArchive.zip</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">gzip output is, as expected, empty, but due to this condition: <a href="https://github.com/file/file/blob/master/src/compress.c#L993" target="_blank" class="">https://github.com/file/file/blob/master/src/compress.c#L993</a></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">file considers gzip output to be erroneous.</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">To achieve expected output:</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">$ file -z emptyFileArchive.zip</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">emptyFileArchive.zip: empty (Zip archive data, at least v1.0 to extract, compression method=store)<br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">I propose the following patch.</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">best regards,</defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">vincent mihalkovic</defanged_div></p><defanged_div class=""><div class=""><br class="webkit-block-placeholder"></div><defanged_div class=""></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></blockquote><div class=""><br class="webkit-block-placeholder"></div><defanged_div class=""><div class=""><br class="webkit-block-placeholder"></div><defanged_div class=""><span id="cid:f_l88r8dk90"><compression.patch></span>--<span class="Apple-converted-space"> </span><br class="">File mailing list<br class=""><a href="mailto:File@astron.com" class="">File@astron.com</a><br class=""><a href="https://mailman.astron.com/mailman/listinfo/file" class="">https://mailman.astron.com/mailman/listinfo/file</a><br class=""><span id="cid:646DBFC5-386B-4626-B783-25E074D893BB"><sanitizer.log></span></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></div></blockquote></div><br class=""></div></body></html>