diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-01-21 13:07:41 -0500 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-01-21 13:07:41 -0500 |
| commit | d5e632d853da69d61b488ac26773c547ac655c6a (patch) | |
| tree | 4582434984560e25ec9e033aec13f0ddbcbdf121 /lisp/subr.el | |
| parent | d00b05c949aa1078922281188cdb74689077ddfa (diff) | |
| download | emacs-d5e632d853da69d61b488ac26773c547ac655c6a.tar.gz | |
* lisp/subr.el (shell-quote-argument): Properly quote \n.
Suggested by Flo <sensorflo@gmail.com>.
Fixes: debbugs:7687
Diffstat (limited to 'lisp/subr.el')
| -rw-r--r-- | lisp/subr.el | 9 |
1 files changed, 2 insertions, 7 deletions
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." "''" ;; Quote everything except POSIX filename characters. ;; This should be safe enough even for really weird shells. - (let ((result "") (start 0) end) - (while (string-match "[^-0-9a-zA-Z_./]" argument start) - (setq end (match-beginning 0) - result (concat result (substring argument start end) - "\\" (substring argument end (1+ end))) - start (1+ end))) - (concat result (substring argument start)))))) + (replace-regexp-in-string "\n" "'\n'" + (replace-regexp-in-string "[^-0-9a-zA-Z_./\n]" "\\\\\\&" argument))))) (defun string-or-null-p (object) "Return t if OBJECT is a string or nil. |
