summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el9
1 files changed, 2 insertions, 7 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index d36e96e5f89..2a1619c0903 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2461,13 +2461,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.