emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 35656b6: Improve error checking in tramp-adb.el


From: Michael Albinus
Subject: [Emacs-diffs] master 35656b6: Improve error checking in tramp-adb.el
Date: Fri, 07 Aug 2015 18:25:27 +0000

branch: master
commit 35656b6fa473a4c422875a61d24ebb736c1be4e9
Author: Jürgen Hötzel <address@hidden>
Commit: Michael Albinus <address@hidden>

    Improve error checking in tramp-adb.el
    
    * lisp/net/tramp-adb.el (tramp-adb-ls-output-name-less-p):
    Improve error checking.  "ls -l" on Android in Enforcing mode can
    print "lstat './FILENAME failed: Permission denied".
---
 lisp/net/tramp-adb.el |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 6305921..b81f597 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -497,12 +497,11 @@ Emacs dired can't find files."
 
 (defun tramp-adb-ls-output-name-less-p (a b)
   "Sort \"ls\" output by name, ascending."
-  (let (posa posb)
-    (string-match directory-listing-before-filename-regexp a)
-    (setq posa (match-end 0))
-    (string-match directory-listing-before-filename-regexp b)
-    (setq posb (match-end 0))
-    (string-lessp (substring a posa) (substring b posb))))
+  (if (string-match directory-listing-before-filename-regexp a)
+      (let ((posa (match-end 0)))
+       (if (string-match directory-listing-before-filename-regexp b)
+           (let ((posb (match-end 0)))
+             (string-lessp (substring a posa) (substring b posb)))))))
 
 (defun tramp-adb-handle-make-directory (dir &optional parents)
   "Like `make-directory' for Tramp files."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]