From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43597: 28.0.50; arc-mode.el fails to display a ZIP file Date: Fri, 25 Sep 2020 16:33:21 +0300 Message-ID: <83mu1ernfi.fsf@gnu.org> References: <874knnvt79.fsf@gmx.net> <87y2ky7wi4.fsf@igel.home> <87zh5evrgw.fsf@gmx.net> <83a6xetmxt.fsf@gnu.org> <87sgb6qqft.fsf@gmx.net> <833636tcx0.fsf@gnu.org> <83zh5erxm2.fsf@gnu.org> <83y2kyrui6.fsf@gnu.org> <87h7rmnjt7.fsf@gmx.net> <83r1qqrpy7.fsf@gnu.org> <83o8lurpq3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30986"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43597@debbugs.gnu.org To: stephen.berman@gmx.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 25 15:34:30 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLnrn-0007qR-8l for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Sep 2020 15:34:27 +0200 Original-Received: from localhost ([::1]:35876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLnrm-0006tF-8k for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Sep 2020 09:34:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLnrO-0006ly-RQ for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2020 09:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLnrO-00073T-Hr for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2020 09:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLnrO-0000ad-Ex for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2020 09:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Sep 2020 13:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43597 X-GNU-PR-Package: emacs Original-Received: via spool by 43597-submit@debbugs.gnu.org id=B43597.16010408102228 (code B ref 43597); Fri, 25 Sep 2020 13:34:02 +0000 Original-Received: (at 43597) by debbugs.gnu.org; 25 Sep 2020 13:33:30 +0000 Original-Received: from localhost ([127.0.0.1]:43049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLnqs-0000Zr-IP for submit@debbugs.gnu.org; Fri, 25 Sep 2020 09:33:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLnqo-0000Zb-H2 for 43597@debbugs.gnu.org; Fri, 25 Sep 2020 09:33:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36862) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLnqf-0006yo-HF; Fri, 25 Sep 2020 09:33:20 -0400 Original-Received: from [176.228.60.248] (port=3879 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kLnqZ-0007yg-9v; Fri, 25 Sep 2020 09:33:11 -0400 In-Reply-To: <83o8lurpq3.fsf@gnu.org> (message from Eli Zaretskii on Fri, 25 Sep 2020 15:43:48 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188969 Archived-At: > Date: Fri, 25 Sep 2020 15:43:48 +0300 > From: Eli Zaretskii > Cc: 43597@debbugs.gnu.org > > > Date: Fri, 25 Sep 2020 15:38:56 +0300 > > From: Eli Zaretskii > > Cc: 43597@debbugs.gnu.org > > > > Thanks, with this file I do see the problem. > > Oops, I spoke too soon, using the wrong version of Emacs to test this. > > The change -1 => #xffffffff fixes the problem with this file as well. > So I guess the remaining issues rear their ugly heads in a 64-bit > Emacs, and I need to debug there... Wrong again, sigh... This has nothing to do with 64-bit builds. Anyway, here's the proposed patch, please test: diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index d6e85bf..c09f78e 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1799,10 +1799,10 @@ archive-zip-summarize files visual emacs-int-has-32bits) - (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. + (when (or (= p #xffffffff) (= p -1)) + ;; If the offset of end-of-central-directory is 0xFFFFFFFF, this + ;; is a Zip64 extended ZIP file format, and we need to glean the + ;; info from Zip64 records instead. ;; ;; First, find the Zip64 end-of-central-directory locator. (search-backward "PK\006\007") @@ -1828,6 +1828,15 @@ archive-zip-summarize (efnname (let ((str (buffer-substring (+ p 46) (+ p 46 fnlen)))) (decode-coding-string str archive-file-name-coding-system))) + (ucsize (if (and (or (= ucsize #xffffffff) (= ucsize -1)) + (> exlen 0)) + ;; APPNOTE.TXT, para 4.5.3: the Extra Field + ;; begins with 2 bytes of signature + ;; (\000\001), followed by 2 bytes that give + ;; the size of the extra block, followed by + ;; an 8-byte uncompressed size. + (archive-l-e (+ p 46 fnlen 4) 8) + ucsize)) (isdir (and (= ucsize 0) (string= (file-name-nondirectory efnname) ""))) (mode (cond ((memq creator '(2 3)) ; Unix