Patch 8.2.4397
Problem: Crash when using many composing characters in error message.
Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
Files: src/testing.c, src/testdir/test_assert.vim
*** ../vim-8.2.4396/src/testing.c 2022-02-01 10:15:56.935952340 +0000
--- src/testing.c 2022-02-16 12:14:25.865262374 +0000
***************
*** 101,107 ****
{
same_len = 1;
s = p;
! c = mb_ptr2char_adv(&s);
clen = s - p;
while (*s != NUL && c == mb_ptr2char(s))
{
--- 101,107 ----
{
same_len = 1;
s = p;
! c = mb_cptr2char_adv(&s);
clen = s - p;
while (*s != NUL && c == mb_ptr2char(s))
{
*** ../vim-8.2.4396/src/testdir/test_assert.vim 2021-07-27 21:00:39.753712380 +0100
--- src/testdir/test_assert.vim 2022-02-16 12:13:17.177336755 +0000
***************
*** 53,58 ****
--- 53,66 ----
call assert_equal("\b\e\f\n\t\r\\\x01\x7f", 'x')
call assert_match('Expected ''\\b\\e\\f\\n\\t\\r\\\\\\x01\\x7f'' but got ''x''', v:errors[0])
call remove(v:errors, 0)
+
+ " many composing characters are handled properly
+ call setline(1, ' ')
+ norm 100gr݀
+ call assert_equal(1, getline(1))
+ call assert_match("Expected 1 but got '.* occurs 100 times]'", v:errors[0])
+ call remove(v:errors, 0)
+ bwipe!
endfunc
func Test_assert_equal_dict()
*** ../vim-8.2.4396/src/version.c 2022-02-15 21:33:24.602930114 +0000
--- src/version.c 2022-02-16 12:01:10.113349125 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4397,
/**/
--
There is a difference between "should work" and "does work",
it's called testing.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///