summaryrefslogtreecommitdiff
path: root/lisp/find-dired.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2006-08-28 08:02:38 +0000
committerKim F. Storm <storm@cua.dk>2006-08-28 08:02:38 +0000
commit2fda9976e99cd7578e0a983bc57fefcbbccfc1a7 (patch)
tree42d89cd28bf6ce706319248e99db1da8c87400cd /lisp/find-dired.el
parent31bf51258a6e4ce3a33922e3fe284eb221d3cc15 (diff)
downloademacs-2fda9976e99cd7578e0a983bc57fefcbbccfc1a7.tar.gz
(find-dired): Use shell-quote-argument to properly
escape ( and ) args. Also use it on {} and ; args in default value of find-ls-option string. (find-grep-dired): Use shell-quote-argument on {} and ; args.
Diffstat (limited to 'lisp/find-dired.el')
-rw-r--r--lisp/find-dired.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 88e5414d525..a2895133c27 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -129,8 +129,17 @@ as the final argument."
args (concat find-dired-find-program " . "
(if (string= args "")
""
- (concat "\\( " args " \\) "))
- (car find-ls-option)))
+ (concat
+ (shell-quote-argument "(")
+ " " args " "
+ (shell-quote-argument ")")
+ " "))
+ (if (equal (car find-ls-option) "-exec ls -ld {} \\;")
+ (concat "-exec ls -ld "
+ (shell-quote-argument "{}")
+ " "
+ (shell-quote-argument ";"))
+ (car find-ls-option))))
;; Start the find process.
(shell-command (concat args "&") (current-buffer))
;; The next statement will bomb in classic dired (no optional arg allowed)
@@ -215,7 +224,10 @@ Thus ARG can also contain additional grep options."
(find-dired dir
(concat "-type f -exec grep " find-grep-options " -e "
(shell-quote-argument regexp)
- " {} \\\; ")))
+ " "
+ (shell-quote-argument "{}")
+ " "
+ (shell-quote-argument ";"))))
(defun find-dired-filter (proc string)
;; Filter for \\[find-dired] processes.