From aeb881412c8a724a8a3265f47fce8b63c86defc6 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 9 Jun 2015 23:19:58 +0900 Subject: [PATCH] Fixing regexp-replace substring index error on non-ascii inputs. --- lib/chibi/regexp.scm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/chibi/regexp.scm b/lib/chibi/regexp.scm index 6bce2ef6..109c0446 100644 --- a/lib/chibi/regexp.scm +++ b/lib/chibi/regexp.scm @@ -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}.