changeset 95305:b15e567fa2ab

Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1179
author Miles Bader <miles@gnu.org>
date Mon, 26 May 2008 06:57:40 +0000
parents 300e5a5c5a17 (current diff) 3c39bed710aa (diff)
children f341d5aaa71c
files lisp/ChangeLog lisp/progmodes/cc-mode.el lisp/tar-mode.el
diffstat 3 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon May 26 06:57:27 2008 +0000
+++ b/lisp/ChangeLog	Mon May 26 06:57:40 2008 +0000
@@ -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.
--- a/lisp/progmodes/cc-mode.el	Mon May 26 06:57:27 2008 +0000
+++ b/lisp/progmodes/cc-mode.el	Mon May 26 06:57:40 2008 +0000
@@ -719,6 +719,7 @@
       (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)
--- a/lisp/tar-mode.el	Mon May 26 06:57:27 2008 +0000
+++ b/lisp/tar-mode.el	Mon May 26 06:57:40 2008 +0000
@@ -428,6 +428,16 @@
                                  (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 @@
               (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 @@
 
           (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,