* lisp/net/tramp-sh.el (tramp-convert-file-attributes):
Revert patch from 2015-08-24. Tramp shall be have like for local files. * test/automated/tramp-tests.el (tramp-test18-file-attributes): Adapt test.
This commit is contained in:
parent
001c7dd928
commit
cc90c25a50
2 changed files with 12 additions and 13 deletions
|
@ -5114,18 +5114,10 @@ raises an error."
|
|||
Convert file mode bits to string and set virtual device number.
|
||||
Return ATTR."
|
||||
(when attr
|
||||
;; Convert symlink from `tramp-do-file-attributes-with-stat'.
|
||||
(when (consp (car attr))
|
||||
(if (and (stringp (caar attr))
|
||||
(string-match ".+ -> .\\(.+\\)." (caar attr)))
|
||||
(setcar attr (match-string 1 (caar attr)))
|
||||
(setcar attr nil)))
|
||||
;; Remove color escape sequences and double slashes from symlink.
|
||||
;; Remove color escape sequences from symlink.
|
||||
(when (stringp (car attr))
|
||||
(while (string-match tramp-color-escape-sequence-regexp (car attr))
|
||||
(setcar attr (replace-match "" nil nil (car attr))))
|
||||
(while (string-match "//" (car attr))
|
||||
(setcar attr (replace-match "/" nil nil (car attr)))))
|
||||
(setcar attr (replace-match "" nil nil (car attr)))))
|
||||
;; Convert uid and gid. Use -1 as indication of unusable value.
|
||||
(when (and (numberp (nth 2 attr)) (< (nth 2 attr) 0))
|
||||
(setcar (nthcdr 2 attr) -1))
|
||||
|
@ -5166,6 +5158,12 @@ Return ATTR."
|
|||
;; Convert directory indication bit.
|
||||
(when (string-match "^d" (nth 8 attr))
|
||||
(setcar attr t))
|
||||
;; Convert symlink from `tramp-do-file-attributes-with-stat'.
|
||||
(when (consp (car attr))
|
||||
(if (and (stringp (caar attr))
|
||||
(string-match ".+ -> .\\(.+\\)." (caar attr)))
|
||||
(setcar attr (match-string 1 (caar attr)))
|
||||
(setcar attr nil)))
|
||||
;; Set file's gid change bit.
|
||||
(setcar (nthcdr 9 attr)
|
||||
(if (numberp (nth 3 attr))
|
||||
|
|
|
@ -1118,9 +1118,10 @@ This tests also `file-readable-p' and `file-regular-p'."
|
|||
t)))
|
||||
(when (file-symlink-p tmp-name2)
|
||||
(setq attr (file-attributes tmp-name2))
|
||||
(should (string-equal
|
||||
(car attr)
|
||||
(file-remote-p (file-truename tmp-name3) 'localname)))
|
||||
(should
|
||||
(string-equal
|
||||
(car attr)
|
||||
(tramp-file-name-localname (tramp-dissect-file-name tmp-name3))))
|
||||
(delete-file tmp-name2))
|
||||
|
||||
(delete-file tmp-name1)
|
||||
|
|
Loading…
Add table
Reference in a new issue