]> git.eshelyaron.com Git - emacs.git/commitdiff
(archive-arc-summarize, archive-lzh-summarize): Convert csize to integer when
authorEli Zaretskii <eliz@gnu.org>
Tue, 16 May 2006 18:28:40 +0000 (18:28 +0000)
committerEli Zaretskii <eliz@gnu.org>
Tue, 16 May 2006 18:28:40 +0000 (18:28 +0000)
computing offsets within the compressed archive file.

lisp/ChangeLog
lisp/arc-mode.el

index 147e449c35192d33a414a63142ffb0a19574338a..1f7f52b637bf803091af18fdc6cc7f148f806d5e 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-16  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <storm@cua.dk>
 
        * subr.el (add-to-history): Add KEEP-ALL arg and align functionality
index 96b41eca88d72f99c6bb8f0b482e978999b2e18d..0b016b981e2b2877d8b39879c3294c0e11c9ce3f 100644 (file)
@@ -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)