aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/dired.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 4f8f615a34b..e1bedb6c73f 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1276,12 +1276,17 @@ see `dired-use-ls-dired' for more details.")
1276 ;; call for wildcards. 1276 ;; call for wildcards.
1277 (when (file-remote-p dir) 1277 (when (file-remote-p dir)
1278 (setq switches (dired-replace-in-string "--dired" "" switches))) 1278 (setq switches (dired-replace-in-string "--dired" "" switches)))
1279 (let ((default-directory (car dir-wildcard)) 1279 (let* ((default-directory (car dir-wildcard))
1280 (script (format "ls %s %s" switches (cdr dir-wildcard)))) 1280 (script (format "ls %s %s" switches (cdr dir-wildcard)))
1281 (remotep (file-remote-p dir))
1282 (sh (or (and remotep "/bin/sh")
1283 (and (bound-and-true-p explicit-shell-file-name)
1284 (executable-find explicit-shell-file-name))
1285 (executable-find "sh")))
1286 (switch (if remotep "-c" shell-command-switch)))
1281 (unless 1287 (unless
1282 (zerop 1288 (zerop
1283 (process-file 1289 (process-file sh nil (current-buffer) nil switch script))
1284 "/bin/sh" nil (current-buffer) nil "-c" script))
1285 (user-error 1290 (user-error
1286 "%s: No files matching wildcard" (cdr dir-wildcard))) 1291 "%s: No files matching wildcard" (cdr dir-wildcard)))
1287 (insert-directory-clean (point) switches))) 1292 (insert-directory-clean (point) switches)))