From 7cc9d2b2b2e2cc4e78bf37512ac03ded3e18d6c1 Mon Sep 17 00:00:00 2001 From: KunMing Xie Date: Sun, 10 Jun 2018 18:31:51 +0800 Subject: vim-patch:8.0.0520: using a function pointer while the function is known (#8513) 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 vim/vim#1582) https://github.com/vim/vim/commit/ace95989ed81929a84e205b26d0972cb9d6b4b19 --- src/nvim/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index fba61e53a7..188e3544e6 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -286,7 +286,7 @@ void trunc_string(char_u *s, char_u *buf, int room_in, int buflen) half = i = (int)STRLEN(s); for (;;) { do { - half = half - (*mb_head_off)(s, s + half - 1) - 1; + half = half - utf_head_off(s, s + half - 1) - 1; } while (half > 0 && utf_iscomposing(utf_ptr2char(s + half))); n = ptr2cells(s + half); if (len + n > room || half == 0) { -- cgit