comparison lisp/tar-mode.el @ 103321:f50defb23b3e

(tar-header-block-tokenize): Obey @LongLink even for POSIX tar archives (bug#3410).
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 04 Jun 2009 20:48:16 +0000
parents f4adb8b6af6c
children 68150c643e2e
comparison
equal deleted inserted replaced
103320:8d8a82b45ba7 103321:f50defb23b3e
274 (decode-coding-string linkname coding))) 274 (decode-coding-string linkname coding)))
275 (if (and (null link-p) (string-match "/\\'" name)) 275 (if (and (null link-p) (string-match "/\\'" name))
276 (setq link-p 5)) ; directory 276 (setq link-p 5)) ; directory
277 277
278 (if (and (equal name "././@LongLink") 278 (if (and (equal name "././@LongLink")
279 (equal magic-str "ustar ")) ;OLDGNU_MAGIC. 279 ;; Supposedly @LongLink is only used for GNUTAR
280 ;; format (i.e. "ustar ") but some POSIX Tar files
281 ;; (with "ustar\0") have been seen using it as well.
282 (member magic-str '("ustar " "ustar\0")))
280 ;; This is a GNU Tar long-file-name header. 283 ;; This is a GNU Tar long-file-name header.
281 (let* ((size (tar-parse-octal-integer 284 (let* ((size (tar-parse-octal-integer
282 string tar-size-offset tar-time-offset)) 285 string tar-size-offset tar-time-offset))
283 ;; -1 so as to strip the terminating 0 byte. 286 ;; -1 so as to strip the terminating 0 byte.
284 (name (buffer-substring pos (+ pos size -1))) 287 (name (buffer-substring pos (+ pos size -1)))