Commit 9f2bd2e7 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(combine-and-quote-strings): Also quote strings that contain the separator.

parent e66d8771
......@@ -10,6 +10,9 @@
 
2008-04-07 Stefan Monnier <monnier@iro.umontreal.ca>
 
* subr.el (combine-and-quote-strings): Also quote strings that contain
the separator.
* pcvs-util.el (cvs-map): Avoid recursion :-(
 
2008-04-07 Glenn Morris <rgm@gnu.org>
......
......@@ -2987,10 +2987,11 @@ Modifies the match data; use `save-match-data' if necessary."
This tries to quote the strings to avoid ambiguity such that
(split-string-and-unquote (combine-and-quote-strings strs)) == strs
Only some SEPARATORs will work properly."
(let ((sep (or separator " ")))
(let* ((sep (or separator " "))
(re (concat "[\\\"]" "\\|" (regexp-quote sep))))
(mapconcat
(lambda (str)
(if (string-match "[\\\"]" str)
(if (string-match re str)
(concat "\"" (replace-regexp-in-string "[\\\"]" "\\\\\\&" str) "\"")
str))
strings sep)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment