From 31e54db06aefd333f9f69d1ad2c3f01868e60db4 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 13 Aug 2012 12:34:25 +0200 Subject: [PATCH] * 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. --- lisp/ChangeLog | 5 +++++ lisp/tar-mode.el | 17 ++++++++--------- 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 @@ 2012-08-13 Andreas Schwab + * 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. + * files.el (hack-local-variables-filter): Remove useless eval. 2012-08-13 Martin Rudalics 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." (defun tar-header-data-end (descriptor) (let* ((data-start (tar-header-data-start descriptor)) (link-type (tar-header-link-type descriptor)) - (size (tar-header-size descriptor)) - (fudge (cond - ;; Foo. There's an extra empty block after these. - ((memq link-type '(20 55)) 512) - (t 0)))) - (+ data-start fudge - (if (and (null link-type) (> size 0)) + (size (tar-header-size descriptor))) + (+ data-start + ;; Ignore size for files of type 1-6 + (if (and (not (memq link-type '(1 2 3 4 5 6))) (> size 0)) (tar-roundup-512 size) 0)))) @@ -445,7 +442,8 @@ MODE should be an integer which is a file mode value." ((eq type 29) ?M) ; multivolume continuation ((eq type 35) ?S) ; sparse ((eq type 38) ?V) ; volume header - ((eq type 55) ?H) ; extended pax header + ((eq type 55) ?H) ; pax global extended header + ((eq type 72) ?X) ; pax extended header (t ?\s) ) (tar-grind-file-mode mode) @@ -751,7 +749,8 @@ tar-file's buffer." ((eq link-p 29) "a multivolume-continuation") ((eq link-p 35) "a sparse entry") ((eq link-p 38) "a volume header") - ((eq link-p 55) "an extended pax header") + ((eq link-p 55) "a pax global extended header") + ((eq link-p 72) "a pax extended header") (t "a link")))) (if (zerop size) (message "This is a zero-length file")) descriptor)) -- 2.39.2