changeset 94296:f6d5eb496a39

(tar-untar-buffer): If the entry has directory link type, extract it as a directory even if its file name doesn't end with a slash. Fixes extraction of NetBSD tar archives.
author Magnus Henoch <mange@freemail.hu>
date Wed, 23 Apr 2008 16:46:43 +0000
parents 11c1515dc9e3
children af2c231545b2
files lisp/tar-mode.el
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/tar-mode.el	Wed Apr 23 15:37:07 2008 +0000
+++ b/lisp/tar-mode.el	Wed Apr 23 16:46:43 2008 +0000
@@ -395,7 +395,9 @@
 	  (dolist (descriptor tar-parse-info)
 	    (let* ((tokens (tar-desc-tokens descriptor))
 		   (name (tar-header-name tokens))
-		   (dir (file-name-directory name))
+		   (dir (if (eq (tar-header-link-type tokens) 5)
+			    name
+			  (file-name-directory name)))
 		   (start (+ (tar-desc-data-start descriptor)
 			     (- tar-header-offset (point-min))))
 		   (end (+ start (tar-header-size tokens))))