Show
Ignore:
Timestamp:
05/13/06 11:31:18 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/arc-mode.el

    r4058 r4079  
    465465  (intern (concat "archive-" (symbol-name archive-subtype) "-" suffix))) 
    466466 
    467 (defun archive-l-e (str &optional len
     467(defun archive-l-e (str &optional len float
    468468  "Convert little endian string/vector STR to integer. 
    469469Alternatively, STR may be a buffer position in the current buffer 
    470 in which case a second argument, length LEN, should be supplied." 
     470in which case a second argument, length LEN, should be supplied. 
     471FLOAT, if non-nil, means generate and return a float instead of an integer 
     472\(use this for numbers that can overflow the Emacs integer)." 
    471473  (if (stringp str) 
    472474      (setq len (length str)) 
     
    476478    (while (< i len) 
    477479      (setq i (1+ i) 
    478             result (+ (ash result 8) (aref str (- len i))))) 
     480            result (+ (if float (* result 256.0) (ash result 8)) 
     481                      (aref str (- len i))))) 
    479482    result)) 
    480483 
     
    861864  (save-excursion 
    862865    (goto-char (point-min)) 
    863     (let ((coding 
     866    (let ((buffer-undo-list t) 
     867          (coding 
    864868           (or coding-system-for-read 
    865869               (and set-auto-coding-function 
     
    13321336             (fnlen   (or (string-match "\0" namefld) 13)) 
    13331337             (efnname (substring namefld 0 fnlen)) 
    1334              (csize   (archive-l-e (+ p 15) 4)) 
     1338             ;; Convert to float to avoid overflow for very large files. 
     1339             (csize   (archive-l-e (+ p 15) 4 'float)) 
    13351340             (moddate (archive-l-e (+ p 19) 2)) 
    13361341             (modtime (archive-l-e (+ p 21) 2)) 
    1337              (ucsize  (archive-l-e (+ p 25) 4)) 
     1342             (ucsize  (archive-l-e (+ p 25) 4 'float)) 
    13381343             (fiddle  (string= efnname (upcase efnname))) 
    13391344             (ifnname (if fiddle (downcase efnname) efnname)) 
    1340              (text    (format "  %8d  %-11s  %-8s  %s" 
     1345             (text    (format "  %8.0f  %-11s  %-8s  %s" 
    13411346                              ucsize 
    13421347                              (archive-dosdate moddate) 
     
    13601365      (archive-summarize-files (nreverse visual)) 
    13611366      (insert dash 
    1362               (format "  %8d                         %d file%s" 
     1367              (format "  %8.0f                         %d file%s" 
    13631368                      totalsize 
    13641369                      (length files) 
     
    13941399                  (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-")) 
    13951400      (let* ((hsize   (char-after p))   ;size of the base header (level 0 and 1) 
    1396              (csize   (archive-l-e (+ p 7) 4)) ;size of a compressed file to follow (level 0 and 2), 
     1401             ;; Convert to float to avoid overflow for very large files. 
     1402             (csize   (archive-l-e (+ p 7) 4 'float)) ;size of a compressed file to follow (level 0 and 2), 
    13971403                                        ;size of extended headers + the compressed file to follow (level 1). 
    1398              (ucsize  (archive-l-e (+ p 11) 4))       ;size of an uncompressed file. 
     1404             (ucsize  (archive-l-e (+ p 11) 4 'float))        ;size of an uncompressed file. 
    13991405             (time1   (archive-l-e (+ p 15) 2)) ;date/time (MSDOS format in level 0, 1 headers 
    14001406             (time2   (archive-l-e (+ p 17) 2)) ;and UNIX format in level 2 header.) 
     
    14721478                        (archive-dostime time1))) 
    14731479        (setq text    (if archive-alternate-display 
    1474                           (format "  %8d  %5S  %5S  %s" 
     1480                          (format "  %8.0f  %5S  %5S  %s" 
    14751481                                  ucsize 
    14761482                                  (or uid "?") 
    14771483                                  (or gid "?") 
    14781484                                  ifnname) 
    1479                         (format "  %10s  %8d  %-11s  %-8s  %s" 
     1485                        (format "  %10s  %8.0f  %-11s  %-8s  %s" 
    14801486                                modestr 
    14811487                                ucsize 
     
    15071513                    "M   Filemode    Length  Date         Time      File\n")) 
    15081514          (sumline (if archive-alternate-display 
    1509                        "  %8d                %d file%s" 
    1510                      "              %8d                         %d file%s"))) 
     1515                       "  %8.0f                %d file%s" 
     1516                     "              %8.0f                         %d file%s"))) 
    15111517      (insert header dash) 
    15121518      (archive-summarize-files (nreverse visual)) 
     
    16041610             (modtime (archive-l-e (+ p 12) 2)) 
    16051611             (moddate (archive-l-e (+ p 14) 2)) 
    1606              (ucsize  (archive-l-e (+ p 24) 4)) 
     1612             ;; Convert to float to avoid overflow for very large files. 
     1613             (ucsize  (archive-l-e (+ p 24) 4 'float)) 
    16071614             (fnlen   (archive-l-e (+ p 28) 2)) 
    16081615             (exlen   (archive-l-e (+ p 30) 2)) 
     
    16301637             (ifnname (if fiddle (downcase efnname) efnname)) 
    16311638             (width (string-width ifnname)) 
    1632              (text    (format "  %10s  %8d  %-11s  %-8s  %s" 
     1639             (text    (format "  %10s  %8.0f  %-11s  %-8s  %s" 
    16331640                              modestr 
    16341641                              ucsize 
     
    16561663      (archive-summarize-files (nreverse visual)) 
    16571664      (insert dash 
    1658               (format "              %8d                         %d file%s" 
     1665              (format "              %8.0f                         %d file%s" 
    16591666                      totalsize 
    16601667                      (length files) 
     
    17101717             (moddate (archive-l-e (+ p 14) 2)) 
    17111718             (modtime (archive-l-e (+ p 16) 2)) 
    1712              (ucsize  (archive-l-e (+ p 20) 4)) 
     1719             ;; Convert to float to avoid overflow for very large files. 
     1720             (ucsize  (archive-l-e (+ p 20) 4 'float)) 
    17131721             (namefld (buffer-substring (+ p 38) (+ p 38 13))) 
    17141722             (dirtype (char-after (+ p 4))) 
     
    17341742             (ifnname (if fiddle (downcase efnname) efnname)) 
    17351743             (width (string-width ifnname)) 
    1736              (text    (format "  %8d  %-11s  %-8s  %s" 
     1744             (text    (format "  %8.0f  %-11s  %-8s  %s" 
    17371745                              ucsize 
    17381746                              (archive-dosdate moddate) 
     
    17561764      (archive-summarize-files (nreverse visual)) 
    17571765      (insert dash 
    1758               (format "  %8d                         %d file%s" 
     1766              (format "  %8.0f                         %d file%s" 
    17591767                      totalsize 
    17601768                      (length files)