From: Jürgen Hötzel Date: Fri, 7 Aug 2015 18:24:45 +0000 (+0200) Subject: Improve error checking in tramp-adb.el X-Git-Tag: emacs-25.0.90~1373^2~94 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=35656b6fa473a4c422875a61d24ebb736c1be4e9;p=emacs.git 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". --- diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 63059218579..b81f5974cc7 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."