# HG changeset patch # User Stefan Monnier # Date 1295633261 18000 # Node ID 106bf56d370ea299fa9d48de806c75b696563a77 # Parent a2432c16dc9f5c8ac4489676edd28213bd091a54 * lisp/subr.el (shell-quote-argument): Properly quote \n. Suggested by Flo . diff -r a2432c16dc9f -r 106bf56d370e lisp/ChangeLog --- a/lisp/ChangeLog Thu Jan 20 21:04:45 2011 -0800 +++ b/lisp/ChangeLog Fri Jan 21 13:07:41 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-21 Stefan Monnier + + * subr.el (shell-quote-argument): Properly quote \n (bug#7687). + Suggested by Flo . + 2011-01-21 Glenn Morris * progmodes/compile.el (compilation-error-regexp-alist): diff -r a2432c16dc9f -r 106bf56d370e lisp/subr.el --- a/lisp/subr.el Thu Jan 20 21:04:45 2011 -0800 +++ b/lisp/subr.el Fri Jan 21 13:07:41 2011 -0500 @@ -2426,13 +2426,8 @@ "''" ;; 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.