notmuch.el: Quote arguments to protect from shell interpretation.
authorCarl Worth <cworth@cworth.org>
Wed, 25 Nov 2009 03:08:53 +0000 (19:08 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 25 Nov 2009 03:08:53 +0000 (19:08 -0800)
We want to allow the user to be able to use search expressions with
parentheses and semi-colons, etc. and we definitely don't want the
shell interpreting those!

notmuch.el

index 9a2095458878be35211e48c7e0a94567b0342bfc..551048adf03e6910428696582585c1ce13111316 100644 (file)
@@ -1033,7 +1033,7 @@ This function advances point to the next line when finished."
        (let ((proc (start-process-shell-command
                     "notmuch-search" buffer notmuch-command "search"
                     (if oldest-first "--sort=oldest-first" "--sort=newest-first")
-                    query)))
+                    (shell-quote-argument query))))
          (set-process-sentinel proc 'notmuch-search-process-sentinel)
          (set-process-filter proc 'notmuch-search-process-filter))))
     (run-hooks 'notmuch-search-hook)))