Fixing regexp-replace substring index error on non-ascii inputs.

This commit is contained in:
Alex Shinn 2015-06-09 23:19:58 +09:00
parent c52873e8b9
commit aeb881412c

View file

@ -1025,14 +1025,10 @@
(else
(string-concatenate
(cons
(substring-cursor str
(string-index->offset str start)
(regexp-match-submatch-start m 0))
(substring str start (regexp-match-submatch-start m 0))
(append
(reverse (regexp-apply-match m str subst))
(list (substring-cursor str
(regexp-match-submatch-end m 0)
(string-index->offset str end))))))))))))
(list (substring str (regexp-match-submatch-end m 0) end)))))))))))
;;> Equivalent to \var{regexp-replace}, but replaces all occurrences
;;> of \var{re} in \var{str}.