diff options
| author | Stefan Monnier | 2011-01-21 13:07:41 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-01-21 13:07:41 -0500 |
| commit | d5e632d853da69d61b488ac26773c547ac655c6a (patch) | |
| tree | 4582434984560e25ec9e033aec13f0ddbcbdf121 | |
| parent | d00b05c949aa1078922281188cdb74689077ddfa (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/subr.el | 9 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-01-21 Glenn Morris <rgm@gnu.org> | 6 | 2011-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. |