aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2012-08-13 12:34:25 +0200
committerAndreas Schwab2012-08-13 12:34:25 +0200
commit31e54db06aefd333f9f69d1ad2c3f01868e60db4 (patch)
treeef3e38439d9e9077a4a4f542baf9404988d2519b
parent1b15d8adcf0c90c8a02d94fb57c2982cdc159424 (diff)
downloademacs-31e54db06aefd333f9f69d1ad2c3f01868e60db4.tar.gz
emacs-31e54db06aefd333f9f69d1ad2c3f01868e60db4.zip
* tar-mode.el (tar-header-data-end): Only ignore size for files of
type 1-6. (tar-header-block-summarize, tar-get-descriptor): Handle pax extended headers.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/tar-mode.el17
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 03ba16d91d9..46c534d2454 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12012-08-13 Andreas Schwab <schwab@linux-m68k.org> 12012-08-13 Andreas Schwab <schwab@linux-m68k.org>
2 2
3 * tar-mode.el (tar-header-data-end): Only ignore size for files of
4 type 1-6.
5 (tar-header-block-summarize, tar-get-descriptor): Handle pax
6 extended headers.
7
3 * files.el (hack-local-variables-filter): Remove useless eval. 8 * files.el (hack-local-variables-filter): Remove useless eval.
4 9
52012-08-13 Martin Rudalics <rudalics@gmx.at> 102012-08-13 Martin Rudalics <rudalics@gmx.at>
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 0e818e0be14..9cd69d84250 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -325,13 +325,10 @@ write-date, checksum, link-type, and link-name."
325(defun tar-header-data-end (descriptor) 325(defun tar-header-data-end (descriptor)
326 (let* ((data-start (tar-header-data-start descriptor)) 326 (let* ((data-start (tar-header-data-start descriptor))
327 (link-type (tar-header-link-type descriptor)) 327 (link-type (tar-header-link-type descriptor))
328 (size (tar-header-size descriptor)) 328 (size (tar-header-size descriptor)))
329 (fudge (cond 329 (+ data-start
330 ;; Foo. There's an extra empty block after these. 330 ;; Ignore size for files of type 1-6
331 ((memq link-type '(20 55)) 512) 331 (if (and (not (memq link-type '(1 2 3 4 5 6))) (> size 0))
332 (t 0))))
333 (+ data-start fudge
334 (if (and (null link-type) (> size 0))
335 (tar-roundup-512 size) 332 (tar-roundup-512 size)
336 0)))) 333 0))))
337 334
@@ -445,7 +442,8 @@ MODE should be an integer which is a file mode value."
445 ((eq type 29) ?M) ; multivolume continuation 442 ((eq type 29) ?M) ; multivolume continuation
446 ((eq type 35) ?S) ; sparse 443 ((eq type 35) ?S) ; sparse
447 ((eq type 38) ?V) ; volume header 444 ((eq type 38) ?V) ; volume header
448 ((eq type 55) ?H) ; extended pax header 445 ((eq type 55) ?H) ; pax global extended header
446 ((eq type 72) ?X) ; pax extended header
449 (t ?\s) 447 (t ?\s)
450 ) 448 )
451 (tar-grind-file-mode mode) 449 (tar-grind-file-mode mode)
@@ -751,7 +749,8 @@ tar-file's buffer."
751 ((eq link-p 29) "a multivolume-continuation") 749 ((eq link-p 29) "a multivolume-continuation")
752 ((eq link-p 35) "a sparse entry") 750 ((eq link-p 35) "a sparse entry")
753 ((eq link-p 38) "a volume header") 751 ((eq link-p 38) "a volume header")
754 ((eq link-p 55) "an extended pax header") 752 ((eq link-p 55) "a pax global extended header")
753 ((eq link-p 72) "a pax extended header")
755 (t "a link")))) 754 (t "a link"))))
756 (if (zerop size) (message "This is a zero-length file")) 755 (if (zerop size) (message "This is a zero-length file"))
757 descriptor)) 756 descriptor))