From: Eli Zaretskii Date: Tue, 16 May 2006 18:28:40 +0000 (+0000) Subject: (archive-arc-summarize, archive-lzh-summarize): Convert csize to integer when X-Git-Tag: emacs-pretest-22.0.90~2542 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7893e58999ad286bfe435c4525f5cbe070cb855a;p=emacs.git (archive-arc-summarize, archive-lzh-summarize): Convert csize to integer when computing offsets within the compressed archive file. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 147e449c351..1f7f52b637b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-05-16 Eli Zaretskii + + * arc-mode.el (archive-arc-summarize, archive-lzh-summarize): + Convert csize to integer when computing offsets within the + compressed archive file. + 2006-05-16 Kim F. Storm * subr.el (add-to-history): Add KEEP-ALL arg and align functionality 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)