From: Stephen Berman <stephen.berman@gmx.net>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 43597@debbugs.gnu.org
Subject: bug#43597: 28.0.50; arc-mode.el fails to display a ZIP file
Date: Thu, 24 Sep 2020 23:58:51 +0200 [thread overview]
Message-ID: <87v9g2vntw.fsf@gmx.net> (raw)
In-Reply-To: <87zh5evrgw.fsf@gmx.net> (Stephen Berman's message of "Thu, 24 Sep 2020 22:40:15 +0200")
On Thu, 24 Sep 2020 22:40:15 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:
> On Thu, 24 Sep 2020 22:25:23 +0200 Andreas Schwab <schwab@linux-m68k.org> wrote:
>
>> On Sep 24 2020, Stephen Berman wrote:
>>
>>> In case it helps, here is the final byte sequence in the file (I've
>>> replace the control characters and raw bytes by ASCII representations):
>>>
>>> PK^E^F\377\377\377\377%^@%^@\377\377\377\377\377\377\377\377^@^@
>>
>> That means the archive is in ZIP64 format. See
>> <https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT>. The real
>> values are contained in the zip64 end of central directory record, which
>> has "PK\6\6" as the signature.
>
> Thanks. But then it seems that arc-mode.el doesn't handle this format
> correctly: archive-zip-summarize has this code:
>
> (let ((p (archive-l-e (+ (point) 16) 4))
> files)
> (when (= p -1)
> ;; If the offset of end-of-central-directory is -1, this is a
> ;; Zip64 extended ZIP file format, and we need to glean the info
> ;; from Zip64 records instead.
>
> But the first value returned by archive-l-e for this file is 255, not
> -1, and on each iteration the value increases, so the ZIP64 code in the
> body of the when-clause is never executed.
I've confirmed that changing the when-clause condition to (= p
4294967295) (that's octal 37777777777, hex ffffffff) makes the body get
executed and the contents of the problematic ZIP file are correctly
displayed in archive-mode. Is that the correct fix?
Steve Berman
next prev parent reply other threads:[~2020-09-24 21:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 20:02 bug#43597: 28.0.50; arc-mode.el fails to display a ZIP file Stephen Berman
2020-09-24 20:25 ` Andreas Schwab
2020-09-24 20:40 ` Stephen Berman
2020-09-24 21:58 ` Stephen Berman [this message]
2020-09-24 22:20 ` Stephen Berman
2020-09-25 6:01 ` Eli Zaretskii
2020-09-25 7:13 ` Stephen Berman
2020-09-25 9:37 ` Eli Zaretskii
2020-09-25 9:53 ` Eli Zaretskii
2020-09-25 10:32 ` Stephen Berman
2020-09-25 11:00 ` Eli Zaretskii
2020-09-25 12:05 ` Stephen Berman
2020-09-25 12:38 ` Eli Zaretskii
2020-09-25 12:43 ` Eli Zaretskii
2020-09-25 12:49 ` Stephen Berman
2020-09-25 13:33 ` Eli Zaretskii
2020-09-25 13:58 ` Stephen Berman
2020-09-25 14:12 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9g2vntw.fsf@gmx.net \
--to=stephen.berman@gmx.net \
--cc=43597@debbugs.gnu.org \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).