aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-28 17:13:24 +0800
committerGitHub <noreply@github.com>2023-02-28 17:13:24 +0800
commita87b52d328d5f78965d6eaff7efab7b63069bdc0 (patch)
treeb15a5dcb6d11717e329d213570a570867bce7b60 /src/nvim/eval.c
parent66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c (diff)
parent55d30c459c878224507e90f2a6c1657cdd070668 (diff)
downloadrneovim-a87b52d328d5f78965d6eaff7efab7b63069bdc0.tar.gz
rneovim-a87b52d328d5f78965d6eaff7efab7b63069bdc0.tar.bz2
rneovim-a87b52d328d5f78965d6eaff7efab7b63069bdc0.zip
Merge pull request #22448 from zeertzjq/vim-8.2.2780
vim-patch:8.2.{2780,2782,2783}
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index f8110aa545..698172442e 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -1620,18 +1620,7 @@ void set_var_lval(lval_T *lp, char *endp, typval_T *rettv, int copy, const bool
bool error = false;
const char val = (char)tv_get_number_chk(rettv, &error);
if (!error) {
- garray_T *const gap = &lp->ll_blob->bv_ga;
-
- // Allow for appending a byte. Setting a byte beyond
- // the end is an error otherwise.
- if (lp->ll_n1 < gap->ga_len || lp->ll_n1 == gap->ga_len) {
- ga_grow(&lp->ll_blob->bv_ga, 1);
- tv_blob_set(lp->ll_blob, (int)lp->ll_n1, (uint8_t)val);
- if (lp->ll_n1 == gap->ga_len) {
- gap->ga_len++;
- }
- }
- // error for invalid range was already given in get_lval()
+ tv_blob_set_append(lp->ll_blob, (int)lp->ll_n1, (uint8_t)val);
}
}
} else if (op != NULL && *op != '=') {
@@ -4861,7 +4850,7 @@ void filter_map(typval_T *argvars, typval_T *rettv, int map)
if (filter_map_one(&tv, expr, map, &rem) == FAIL || did_emsg) {
break;
}
- if (tv.v_type != VAR_NUMBER) {
+ if (tv.v_type != VAR_NUMBER && tv.v_type != VAR_BOOL) {
emsg(_(e_invalblob));
return;
}