From 66fa5fd54f550c0790d36c20124c49493b323bfa Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 19 Oct 2020 20:21:03 +0200 Subject: patch 8.2.1866: Vim9: appending to pushed blob gives wrong result Problem: Vim9: appending to pushed blob gives wrong result. Solution: Set ga_maxlen when copying a blob. --- src/blob.c | 1 + src/testdir/test_vim9_func.vim | 6 ++++++ src/version.c | 2 ++ 3 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/blob.c b/src/blob.c index f105170cfb..264962e197 100644 --- a/src/blob.c +++ b/src/blob.c @@ -80,6 +80,7 @@ blob_copy(blob_T *from, typval_T *to) len = 0; } to->vval.v_blob->bv_ga.ga_len = len; + to->vval.v_blob->bv_ga.ga_maxlen = len; } return ret; } diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index bded91f784..4af136cefe 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1790,6 +1790,12 @@ def Test_list_add() CheckDefExecFailure(lines, 'E1130:', 2) enddef +def Test_blob_add() + var b: blob = 0z12 + add(b, 0x34) + assert_equal(0z1234, b) +enddef + def SID(): number return expand('') ->matchstr('\zs\d\+\ze_$') diff --git a/src/version.c b/src/version.c index 2894dedb8c..1b60ebd2a0 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1866, /**/ 1865, /**/ -- cgit v1.2.3