From 67a01490934ba5a43b68b7141b20bc8e636ed7c5 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Mon, 29 Aug 2016 10:35:34 +0200 Subject: Make dired-do-compress understand files with spaces in them * lisp/dired-aux.el (dired-compress-file): Add `shell-quote-argument' and `literal' flag to `replace-regexp-in-string'. --- lisp/dired-aux.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4bdded35fe5..9e0943ac7f0 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1049,10 +1049,12 @@ Return nil if no change in files." (prog1 (setq newname (file-name-as-directory newname)) (dired-shell-command (replace-regexp-in-string - "%o" newname + "%o" (shell-quote-argument newname) (replace-regexp-in-string - "%i" file - command)))) + "%i" (shell-quote-argument file) + command + nil t) + nil t))) ;; We found an uncompression rule. (when (not (dired-check-process @@ -1072,10 +1074,12 @@ Return nil if no change in files." (default-directory (file-name-directory file))) (dired-shell-command (replace-regexp-in-string - "%o" out-name + "%o" (shell-quote-argument out-name) (replace-regexp-in-string - "%i" (file-name-nondirectory file) - (cadr suffix)))) + "%i" (shell-quote-argument (file-name-nondirectory file)) + (cadr suffix) + nil t) + nil t)) out-name))) (let ((out-name (concat file ".gz"))) (and (or (not (file-exists-p out-name)) -- cgit v1.2.1