Fix support for Zip64 zip files
* lisp/arc-mode.el (archive-zip-summarize): Fix detection of Zip64 central directory. Support 64-bit file size field used by Zip64. (Bug#43597)
This commit is contained in:
parent
ba635a19fb
commit
f31c6792ab
1 changed files with 13 additions and 4 deletions
|
@ -1799,10 +1799,10 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
|
||||||
files
|
files
|
||||||
visual
|
visual
|
||||||
emacs-int-has-32bits)
|
emacs-int-has-32bits)
|
||||||
(when (= p -1)
|
(when (or (= p #xffffffff) (= p -1))
|
||||||
;; If the offset of end-of-central-directory is -1, this is a
|
;; If the offset of end-of-central-directory is 0xFFFFFFFF, this
|
||||||
;; Zip64 extended ZIP file format, and we need to glean the info
|
;; is a Zip64 extended ZIP file format, and we need to glean the
|
||||||
;; from Zip64 records instead.
|
;; info from Zip64 records instead.
|
||||||
;;
|
;;
|
||||||
;; First, find the Zip64 end-of-central-directory locator.
|
;; First, find the Zip64 end-of-central-directory locator.
|
||||||
(search-backward "PK\006\007")
|
(search-backward "PK\006\007")
|
||||||
|
@ -1828,6 +1828,15 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
|
||||||
(efnname (let ((str (buffer-substring (+ p 46) (+ p 46 fnlen))))
|
(efnname (let ((str (buffer-substring (+ p 46) (+ p 46 fnlen))))
|
||||||
(decode-coding-string
|
(decode-coding-string
|
||||||
str archive-file-name-coding-system)))
|
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)
|
(isdir (and (= ucsize 0)
|
||||||
(string= (file-name-nondirectory efnname) "")))
|
(string= (file-name-nondirectory efnname) "")))
|
||||||
(mode (cond ((memq creator '(2 3)) ; Unix
|
(mode (cond ((memq creator '(2 3)) ; Unix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue