vim-patch:8.1.0802: negative index doesn't work for Blob

Problem:    Negative index doesn't work for Blob.
Solution:   Make it work, add a test. (closes vim/vim#3856)
a5be9b6248

Leave tv_blob_get()'s return type untouched.
This commit is contained in:
Sean Dewar
2021-07-29 22:54:47 +01:00
parent 23f5999d28
commit bd9c787b4f
3 changed files with 13 additions and 4 deletions

View File

@@ -2266,7 +2266,7 @@ void tv_blob_copy(typval_T *const from, typval_T *const to)
to->vval.v_blob = NULL;
} else {
tv_blob_alloc_ret(to);
const int len = from->vval.v_blob->bv_ga.ga_len;
int len = from->vval.v_blob->bv_ga.ga_len;
if (len > 0) {
to->vval.v_blob->bv_ga.ga_data