aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-01-21 13:07:41 -0500
committerStefan Monnier2011-01-21 13:07:41 -0500
commitd5e632d853da69d61b488ac26773c547ac655c6a (patch)
tree4582434984560e25ec9e033aec13f0ddbcbdf121
parentd00b05c949aa1078922281188cdb74689077ddfa (diff)
downloademacs-d5e632d853da69d61b488ac26773c547ac655c6a.tar.gz
emacs-d5e632d853da69d61b488ac26773c547ac655c6a.zip
* lisp/subr.el (shell-quote-argument): Properly quote \n.
Suggested by Flo <sensorflo@gmail.com>. Fixes: debbugs:7687
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/subr.el9
2 files changed, 7 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 865f46562cf..ac0181e9632 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-01-21 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * subr.el (shell-quote-argument): Properly quote \n (bug#7687).
4 Suggested by Flo <sensorflo@gmail.com>.
5
12011-01-21 Glenn Morris <rgm@gnu.org> 62011-01-21 Glenn Morris <rgm@gnu.org>
2 7
3 * progmodes/compile.el (compilation-error-regexp-alist): 8 * progmodes/compile.el (compilation-error-regexp-alist):
diff --git a/lisp/subr.el b/lisp/subr.el
index 2a0dee69338..391510c4acb 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2426,13 +2426,8 @@ Note: :data and :device are currently not supported on Windows."
2426 "''" 2426 "''"
2427 ;; Quote everything except POSIX filename characters. 2427 ;; Quote everything except POSIX filename characters.
2428 ;; This should be safe enough even for really weird shells. 2428 ;; This should be safe enough even for really weird shells.
2429 (let ((result "") (start 0) end) 2429 (replace-regexp-in-string "\n" "'\n'"
2430 (while (string-match "[^-0-9a-zA-Z_./]" argument start) 2430 (replace-regexp-in-string "[^-0-9a-zA-Z_./\n]" "\\\\\\&" argument)))))
2431 (setq end (match-beginning 0)
2432 result (concat result (substring argument start end)
2433 "\\" (substring argument end (1+ end)))
2434 start (1+ end)))
2435 (concat result (substring argument start))))))
2436 2431
2437(defun string-or-null-p (object) 2432(defun string-or-null-p (object)
2438 "Return t if OBJECT is a string or nil. 2433 "Return t if OBJECT is a string or nil.