summaryrefslogtreecommitdiff
path: root/src/evalbuffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-21 22:19:45 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-21 22:19:45 +0200
commitad48e6c1590842ab6d48e6caba3e9250734dae27 (patch)
treec81fe7bc66f2807223cdf76306dccf5b714f3650 /src/evalbuffer.c
parentff06f283e3e4b3ec43012dd3b83f8454c98f6639 (diff)
downloadvim-git-ad48e6c1590842ab6d48e6caba3e9250734dae27.tar.gz
patch 8.2.0615: regexp benchmark stest is old stylev8.2.0615
Problem: Regexp benchmark stest is old style. Solution: Make it a new style test. Fix using a NULL list. Add more tests. (Yegappan Lakshmanan, closes #5963)
Diffstat (limited to 'src/evalbuffer.c')
-rw-r--r--src/evalbuffer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evalbuffer.c b/src/evalbuffer.c
index 2c20939bd..f11727c78 100644
--- a/src/evalbuffer.c
+++ b/src/evalbuffer.c
@@ -176,6 +176,13 @@ set_buffer_lines(
if (lines->v_type == VAR_LIST)
{
l = lines->vval.v_list;
+ if (l == NULL || list_len(l) == 0)
+ {
+ // set proper return code
+ if (lnum > curbuf->b_ml.ml_line_count)
+ rettv->vval.v_number = 1; // FAIL
+ goto done;
+ }
range_list_materialize(l);
li = l->lv_first;
}
@@ -251,6 +258,7 @@ set_buffer_lines(
update_topline();
}
+done:
if (!is_curbuf)
{
curbuf = curbuf_save;