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 (else
(string-concatenate (string-concatenate
(cons (cons
(substring-cursor str (substring str start (regexp-match-submatch-start m 0))
(string-index->offset str start)
(regexp-match-submatch-start m 0))
(append (append
(reverse (regexp-apply-match m str subst)) (reverse (regexp-apply-match m str subst))
(list (substring-cursor str (list (substring str (regexp-match-submatch-end m 0) end)))))))))))
(regexp-match-submatch-end m 0)
(string-index->offset str end))))))))))))
;;> Equivalent to \var{regexp-replace}, but replaces all occurrences ;;> Equivalent to \var{regexp-replace}, but replaces all occurrences
;;> of \var{re} in \var{str}. ;;> of \var{re} in \var{str}.