]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-adb.el
Improve error checking in tramp-adb.el
[gnu-emacs] / lisp / net / tramp-adb.el
index 6305921857928d819ece6ebc0a00e48619382806..b81f5974cc7b28e93b9e2bcd5a2094edd7722d14 100644 (file)
@@ -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."