Problem: Still not enough memory allocated when converting string with
special character.
Solution: Reserve space for expanding K_SPECIAL. (closes #6130)
{
++p;
// A "\<x>" form occupies at least 4 characters, and produces up
- // to 9 characters (6 for the char and 3 for a modifier): reserve
- // space for 5 extra.
+ // to 21 characters (3 * 6 for the char and 3 for a modifier):
+ // reserve space for 18 extra.
+ // Each byte in the char could be encoded as K_SPECIAL K_EXTRA x.
if (*p == '<')
- extra += 5;
+ extra += 18;
}
}
call assert_equal('a', nr2char(97, 0))
call assert_equal("\x80\xfc\b\xf4\x80\xfeX\x80\xfeX\x80\xfeX", eval('"\<M-' .. nr2char(0x100000) .. '>"'))
+ call assert_equal("\x80\xfc\b\xfd\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX", eval('"\<M-' .. nr2char(0x40000000) .. '>"'))
endfunc
" Test for screenattr(), screenchar() and screenchars() functions
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 824,
/**/
823,
/**/