diff --git a/src/eval.c b/src/eval.c index ecc242dcdd..d0ad7c6e89 100644 --- a/src/eval.c +++ b/src/eval.c @@ -5087,7 +5087,8 @@ echo_string_core( ga_concat(&ga, tv2string(&dtv, &tf, numbuf, copyID)); vim_free(tf); } - ga_concat(&ga, (char_u *)")"); + // terminate with ')' and a NUL + ga_concat_len(&ga, (char_u *)")", 2); *tofree = ga.ga_data; r = *tofree; diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim index 375cb01461..5724eb6a3a 100644 --- a/src/testdir/test_messages.vim +++ b/src/testdir/test_messages.vim @@ -337,4 +337,11 @@ func Test_quit_long_message() call delete('Xtest_quit_message') endfunc +" this was missing a terminating NUL +func Test_echo_string_partial() + function CountSpaces() + endfunction + echomsg function('CountSpaces', [#{aaaaaaaaaaa: v:false, bbbbbbbbbbbb: '', ccccccccccc: ['ab', 'cd']}]) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 372b76050f..5272a5b810 100644 --- a/src/version.c +++ b/src/version.c @@ -749,6 +749,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 3850, /**/ 3849, /**/