]> code.delx.au - gnu-emacs/commitdiff
Merge from emacs--rel--22
authorMiles Bader <miles@gnu.org>
Mon, 26 May 2008 06:57:40 +0000 (06:57 +0000)
committerMiles Bader <miles@gnu.org>
Mon, 26 May 2008 06:57:40 +0000 (06:57 +0000)
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1179

lisp/ChangeLog
lisp/progmodes/cc-mode.el
lisp/tar-mode.el

index 62a777fee6b503c89cf5413003035dd01050dd61..75aebfccfd6a3d3f39a5db64d055a913baa1d794 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * tar-mode.el (tar-summarize-buffer): Handle GNU Tar @LongLink format.
+
 2008-05-26  Glenn Morris  <rgm@gnu.org>
 
        * calendar/cal-hebrew.el (diary-ordinal-suffix): Declare for compiler.
index 03d1019bd5323cfc9c237108039c51a936b1d633..0ae038578b7083b8291e2f838af4c0bc924957d9 100644 (file)
@@ -719,6 +719,7 @@ Note that the style variables are always made local to the buffer."
       (or (stringp c-file-style)
          (error "c-file-style is not a string"))
       (c-set-style c-file-style))
+
     (and c-file-offsets
         (mapc
          (lambda (langentry)
index 1b3a4505cced0086d6052077fda5b9cd0b580daa..881c1263eebd1495a00a88df9b568bceea61b174 100644 (file)
@@ -428,6 +428,16 @@ is visible (and the real data of the buffer is hidden)."
                                  (tar-header-block-tokenize
                                   (buffer-substring pos (+ pos 512)))))))
         (setq pos (+ pos 512))
+        (when (equal (tar-header-name tokens) "././@LongLink")
+          ;; This is a GNU Tar long-file-name header.
+          (let* ((size (tar-header-size tokens))
+                 ;; -1 so as to strip the terminating 0 byte.
+                 (name (buffer-substring pos (+ pos size -1))))
+            (setq pos (+ pos (ash (ash (+ 511 size) -9) 9)))
+            (setq tokens (tar-header-block-tokenize
+                          (buffer-substring pos (+ pos 512))))
+            (tar-setf (tar-header-name tokens) name)
+            (setq pos (+ pos 512))))
         (progress-reporter-update progress-reporter pos)
         (if (memq (tar-header-link-type tokens) '(20 55))
             ;; Foo.  There's an extra empty block after these.
@@ -437,7 +447,7 @@ is visible (and the real data of the buffer is hidden)."
               (error "%s has size %s - corrupted"
                      (tar-header-name tokens) size))
           ;;
-          ;; This is just too slow.  Don't really need it anyway....
+          ;; This is just too slow.  Don't really ened it anyway....
           ;;(tar-header-block-check-checksum
           ;;  hblock (tar-header-block-checksum hblock)
           ;;  (tar-header-name tokens))
@@ -446,10 +456,8 @@ is visible (and the real data of the buffer is hidden)."
 
           (and (null (tar-header-link-type tokens))
                (> size 0)
-               (setq pos
-                     (+ pos 512 (ash (ash (1- size) -9) 9)) ; this works
-                     ;;(+ pos (+ size (- 512 (rem (1- size) 512)))) ; this doesn't
-                     ))))
+               ;; Round up to a multiple of 512.
+               (setq pos (+ pos (ash (ash (+ 511 size) -9) 9))))))
       (make-local-variable 'tar-parse-info)
       (setq tar-parse-info (nreverse result))
       ;; A tar file should end with a block or two of nulls,