]> git.eshelyaron.com Git - emacs.git/commitdiff
(rng-c-fix-escaped-newlines): Use subst-char-in-string
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 25 Jan 2016 15:56:04 +0000 (10:56 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 25 Jan 2016 15:56:04 +0000 (10:56 -0500)
* lisp/nxml/rng-cmpct.el (rng-c-fix-escaped-newlines):
Use subst-char-in-string.

lisp/nxml/rng-cmpct.el

index a699e9e3d96d6249d85c6dd75ca03d0295123619..ed88dfa98e96b3b5554e4e650530fb1852237108 100644 (file)
@@ -674,13 +674,7 @@ the primary expression."
      (substring rng-c-current-token n (- n)))))
 
 (defun rng-c-fix-escaped-newlines (str)
-  (let ((pos 0))
-    (while (progn
-            (let ((n (string-match "\C-@" str pos)))
-              (and n
-                   (aset str n ?\n)
-                   (setq pos (1+ n)))))))
-  str)
+  (subst-char-in-string ?\C-@ ?\n str))
 
 (defun rng-c-parse-identifier-or-keyword ()
   (cond ((rng-c-current-token-ncname-p)