diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 9765b04922..d9765af1dc 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12424,13 +12424,13 @@ static void find_some_match(typval_T *const argvars, typval_T *const rettv, vim_regfree(regmatch.regprog); } - if (type == kSomeMatchStrPos && l == NULL) { +theend: + if (type == kSomeMatchStrPos && l == NULL && rettv->vval.v_list != NULL) { // matchstrpos() without a list: drop the second item list_T *const ret_l = rettv->vval.v_list; tv_list_item_remove(ret_l, TV_LIST_ITEM_NEXT(ret_l, tv_list_first(ret_l))); } -theend: xfree(tofree); p_cpo = save_cpo; } |