diff options
author | Eli Zaretskii <eliz@gnu.org> | 2006-05-16 18:28:40 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2006-05-16 18:28:40 +0000 |
commit | 7893e58999ad286bfe435c4525f5cbe070cb855a (patch) | |
tree | ee547c662a4625aade50e4d89839a7efd8841c85 /lisp/arc-mode.el | |
parent | d749491187cdd71459fd5a5e3521fe61556d6860 (diff) | |
download | emacs-7893e58999ad286bfe435c4525f5cbe070cb855a.tar.gz |
(archive-arc-summarize, archive-lzh-summarize): Convert csize to integer when
computing offsets within the compressed archive file.
Diffstat (limited to 'lisp/arc-mode.el')
-rw-r--r-- | lisp/arc-mode.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 96b41eca88d..0b016b981e2 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1355,7 +1355,11 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." visual) files (cons (vector efnname ifnname fiddle nil (1- p)) files) - p (+ p 29 csize)))) + ;; p needs to stay an integer, since we use it in char-after + ;; above. Passing through `round' limits the compressed size + ;; to most-positive-fixnum, but if the compressed size exceeds + ;; that, we cannot visit the archive anyway. + p (+ p 29 (round csize))))) (goto-char (point-min)) (let ((dash (concat "- -------- ----------- -------- " (make-string maxlen ?-) @@ -1497,9 +1501,13 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." files (cons (vector prname ifnname fiddle mode (1- p)) files)) (cond ((= hdrlvl 1) - (setq p (+ p hsize 2 csize))) + ;; p needs to stay an integer, since we use it in goto-char + ;; above. Passing through `round' limits the compressed size + ;; to most-positive-fixnum, but if the compressed size exceeds + ;; that, we cannot visit the archive anyway. + (setq p (+ p hsize 2 (round csize)))) ((or (= hdrlvl 2) (= hdrlvl 0)) - (setq p (+ p thsize 2 csize)))) + (setq p (+ p thsize 2 (round csize))))) )) (goto-char (point-min)) (set-buffer-multibyte default-enable-multibyte-characters) |