]> code.delx.au - gnu-emacs/commitdiff
* lisp/net/tramp-sh.el (tramp-convert-file-attributes):
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 30 Aug 2015 07:59:02 +0000 (09:59 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 30 Aug 2015 07:59:02 +0000 (09:59 +0200)
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.

lisp/net/tramp-sh.el
test/automated/tramp-tests.el

index c5ffb26b551c7befe9fd7a4766a18820aee1bd0b..8cae8dc92b9c3704b57e875cd795d74533f97720 100644 (file)
@@ -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))
index 498a0cfa7daa86f208b0961e72a971aa8f021d98..c5cab7d5991d9e0a4c458e2ac58d8a1bbf6300dc 100644 (file)
@@ -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)