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>
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)))