patch 8.0.0520: using a function pointer while the function is known
Problem: Using a function pointer instead of the actual function, which we
know.
Solution: Change mb_ functions to utf_ functions when already checked for
Unicode. (Dominique Pelle, closes #1582)
diff --git a/src/spell.c b/src/spell.c
index 1700bba..ed0db8c 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1208,7 +1208,7 @@
/* Need to convert the single byte flags to utf8 characters. */
p = uflags;
for (i = 0; flags[i] != NUL; ++i)
- p += mb_char2bytes(flags[i], p);
+ p += utf_char2bytes(flags[i], p);
*p = NUL;
p = uflags;
}
@@ -5117,11 +5117,11 @@
* SCORE_SUBCOMP. */
if (enc_utf8
&& utf_iscomposing(
- mb_ptr2char(tword
+ utf_ptr2char(tword
+ sp->ts_twordlen
- sp->ts_tcharlen))
&& utf_iscomposing(
- mb_ptr2char(fword
+ utf_ptr2char(fword
+ sp->ts_fcharstart)))
sp->ts_score -=
SCORE_SUBST - SCORE_SUBCOMP;