diff options
| author | Michael Albinus | 2015-08-30 09:59:02 +0200 |
|---|---|---|
| committer | Michael Albinus | 2015-08-30 09:59:02 +0200 |
| commit | cc90c25a50e536669ac327f7e05ec9194d1650d0 (patch) | |
| tree | d190dc1e2f7730af9ba442bb21743061bc4c1777 | |
| parent | 001c7dd928238a196dff4166ad29141116ef6d1c (diff) | |
| download | emacs-cc90c25a50e536669ac327f7e05ec9194d1650d0.tar.gz emacs-cc90c25a50e536669ac327f7e05ec9194d1650d0.zip | |
* 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.
| -rw-r--r-- | lisp/net/tramp-sh.el | 18 | ||||
| -rw-r--r-- | test/automated/tramp-tests.el | 7 |
2 files changed, 12 insertions, 13 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c5ffb26b551..8cae8dc92b9 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -5114,18 +5114,10 @@ raises an error." | |||
| 5114 | Convert file mode bits to string and set virtual device number. | 5114 | Convert file mode bits to string and set virtual device number. |
| 5115 | Return ATTR." | 5115 | Return ATTR." |
| 5116 | (when attr | 5116 | (when attr |
| 5117 | ;; Convert symlink from `tramp-do-file-attributes-with-stat'. | 5117 | ;; Remove color escape sequences from symlink. |
| 5118 | (when (consp (car attr)) | ||
| 5119 | (if (and (stringp (caar attr)) | ||
| 5120 | (string-match ".+ -> .\\(.+\\)." (caar attr))) | ||
| 5121 | (setcar attr (match-string 1 (caar attr))) | ||
| 5122 | (setcar attr nil))) | ||
| 5123 | ;; Remove color escape sequences and double slashes from symlink. | ||
| 5124 | (when (stringp (car attr)) | 5118 | (when (stringp (car attr)) |
| 5125 | (while (string-match tramp-color-escape-sequence-regexp (car attr)) | 5119 | (while (string-match tramp-color-escape-sequence-regexp (car attr)) |
| 5126 | (setcar attr (replace-match "" nil nil (car attr)))) | 5120 | (setcar attr (replace-match "" nil nil (car attr))))) |
| 5127 | (while (string-match "//" (car attr)) | ||
| 5128 | (setcar attr (replace-match "/" nil nil (car attr))))) | ||
| 5129 | ;; Convert uid and gid. Use -1 as indication of unusable value. | 5121 | ;; Convert uid and gid. Use -1 as indication of unusable value. |
| 5130 | (when (and (numberp (nth 2 attr)) (< (nth 2 attr) 0)) | 5122 | (when (and (numberp (nth 2 attr)) (< (nth 2 attr) 0)) |
| 5131 | (setcar (nthcdr 2 attr) -1)) | 5123 | (setcar (nthcdr 2 attr) -1)) |
| @@ -5166,6 +5158,12 @@ Return ATTR." | |||
| 5166 | ;; Convert directory indication bit. | 5158 | ;; Convert directory indication bit. |
| 5167 | (when (string-match "^d" (nth 8 attr)) | 5159 | (when (string-match "^d" (nth 8 attr)) |
| 5168 | (setcar attr t)) | 5160 | (setcar attr t)) |
| 5161 | ;; Convert symlink from `tramp-do-file-attributes-with-stat'. | ||
| 5162 | (when (consp (car attr)) | ||
| 5163 | (if (and (stringp (caar attr)) | ||
| 5164 | (string-match ".+ -> .\\(.+\\)." (caar attr))) | ||
| 5165 | (setcar attr (match-string 1 (caar attr))) | ||
| 5166 | (setcar attr nil))) | ||
| 5169 | ;; Set file's gid change bit. | 5167 | ;; Set file's gid change bit. |
| 5170 | (setcar (nthcdr 9 attr) | 5168 | (setcar (nthcdr 9 attr) |
| 5171 | (if (numberp (nth 3 attr)) | 5169 | (if (numberp (nth 3 attr)) |
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index 498a0cfa7da..c5cab7d5991 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el | |||
| @@ -1118,9 +1118,10 @@ This tests also `file-readable-p' and `file-regular-p'." | |||
| 1118 | t))) | 1118 | t))) |
| 1119 | (when (file-symlink-p tmp-name2) | 1119 | (when (file-symlink-p tmp-name2) |
| 1120 | (setq attr (file-attributes tmp-name2)) | 1120 | (setq attr (file-attributes tmp-name2)) |
| 1121 | (should (string-equal | 1121 | (should |
| 1122 | (car attr) | 1122 | (string-equal |
| 1123 | (file-remote-p (file-truename tmp-name3) 'localname))) | 1123 | (car attr) |
| 1124 | (tramp-file-name-localname (tramp-dissect-file-name tmp-name3)))) | ||
| 1124 | (delete-file tmp-name2)) | 1125 | (delete-file tmp-name2)) |
| 1125 | 1126 | ||
| 1126 | (delete-file tmp-name1) | 1127 | (delete-file tmp-name1) |