From feb5d8a4d340ef247ec581141388f6ba6cfb0d73 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 20 Apr 2014 23:35:55 +0200 Subject: [PATCH] * net/tramp-sh.el (tramp-get-ls-command): Use "-b" argument if possible. --- lisp/ChangeLog | 5 +++++ lisp/net/tramp-sh.el | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d762078dfd0..0b7de93cc02 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-04-20 Michael Albinus + + * net/tramp-sh.el (tramp-get-ls-command): Use "-b" argument if + possible. + 2014-04-19 Stefan Monnier * progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 3b600e3d84e..0dd5b79be92 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4966,6 +4966,12 @@ Return ATTR." vec (format "%s --color=never -al /dev/null" result)) (setq result (concat result " --color=never"))) + ;; This should support file names with special + ;; characters. If this option is not supported, such + ;; file names might fail. + (when (tramp-send-command-and-check + vec (format "%s -b /dev/null" result)) + (setq result (concat result " -b"))) (throw 'ls-found result)) (setq dl (cdr dl)))))) (tramp-error vec 'file-error "Couldn't find a proper `ls' command")))) -- 2.39.5