[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v |
Date: |
Mon, 26 May 2008 06:57:40 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Miles Bader <miles> 08/05/26 06:57:40
Index: tar-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/tar-mode.el,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- tar-mode.el 6 May 2008 07:57:53 -0000 1.123
+++ tar-mode.el 26 May 2008 06:57:37 -0000 1.124
@@ -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,
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v, Glenn Morris, 2008/05/06
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v,
Miles Bader <=
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v, Andreas Schwab, 2008/05/26
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v, Stefan Monnier, 2008/05/27
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v, Stefan Monnier, 2008/05/27
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v, Stefan Monnier, 2008/05/28
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v, Stefan Monnier, 2008/05/29
- [Emacs-diffs] Changes to emacs/lisp/tar-mode.el,v, Miles Bader, 2008/05/31