]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp.el (tramp-handle-file-modes): Handle symlinks.
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 28 Jun 2008 10:17:22 +0000 (10:17 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 28 Jun 2008 10:17:22 +0000 (10:17 +0000)
(tramp-convert-file-attributes): Convert symlinks only when
returned from `tramp-handle-file-attributes-with-stat'.

lisp/ChangeLog
lisp/net/tramp.el

index 7087c1a3606fc17ec1a0da7043e10eff275c8f66..30055bf16d5acfea62db8395bbfa18a10a4e11ee 100644 (file)
@@ -1,3 +1,13 @@
+2008-06-28  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-handle-file-modes): Handle symlinks.
+       (tramp-convert-file-attributes): Convert symlinks only when
+       returned from `tramp-handle-file-attributes-with-stat'.
+
+       * net/tramp-ftp.el (top): Delete 'ange-ftp property from
+       `substitute-in-file-name' when unloading.
+       (tramp-ftp-file-name-handler): Set `tramp-mode' to nil.
+
 2008-06-28  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * vc-dir.el (vc-dir-hide-up-to-date): Also hide empty directories.
index 6dd76abc610f0adfcceb2fce5f5b2bf1345ce1fb..5431290da52b0301f50d31b6af39035207d41cac 100644 (file)
@@ -2675,9 +2675,9 @@ and gid of the corresponding user is taken.  Both parameters must be integers."
 
 (defun tramp-handle-file-modes (filename)
   "Like `file-modes' for Tramp files."
-  (when (file-exists-p filename)
-    (tramp-mode-string-to-int
-     (nth 8 (file-attributes filename)))))
+  (let ((truename (or (file-truename filename) filename)))
+    (when (file-exists-p truename)
+      (tramp-mode-string-to-int (nth 8 (file-attributes truename))))))
 
 (defun tramp-handle-file-directory-p (filename)
   "Like `file-directory-p' for Tramp files."
@@ -6627,9 +6627,11 @@ Return ATTR."
   (unless (stringp (nth 8 attr))
     (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
   ;; Convert directory indication bit.
-  (if (string-match "^d" (nth 8 attr))
-      (setcar attr t)
-    (if (and (listp (car attr)) (stringp (caar attr))
+  (when (string-match "^d" (nth 8 attr))
+    (setcar attr t))
+  ;; Convert symlink from `tramp-handle-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)))