diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-30 22:11:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-30 22:11:44 +0200 |
commit | be7a50c22f63478a6e64fe6b932a847830191b95 (patch) | |
tree | b0cccb704b38d77f8a35bf1774a74b3662c9dc55 | |
parent | 47e880d6c13c3ec2888398fd9ba1f5a7180d791a (diff) |
patch 8.2.1101: no error when using wrong arguments for setqflist()v8.2.1101
Problem: No error when using wrong arguments for setqflist() or
setloclist().
Solution: Check for the error.
-rw-r--r-- | src/quickfix.c | 8 | ||||
-rw-r--r-- | src/testdir/test_quickfix.vim | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 3bd0f75e24..091246b764 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -7400,6 +7400,14 @@ set_errorlist( return OK; } + // A dict argument cannot be specified with a non-empty list argument + if (list != NULL && list->lv_len != 0 && what != NULL) + { + semsg(_(e_invarg2), + _("cannot have both a list and a \"what\" argument")); + return FAIL; + } + incr_quickfix_busy(); if (what != NULL) diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 608a9553b8..6d119fe3e3 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -2360,6 +2360,9 @@ func Xproperty_tests(cchar) call assert_equal(['Colors'], newl2.context) call assert_equal('Line10', newl2.items[0].text) call g:Xsetlist([], 'f') + + " Cannot specify both a non-empty list argument and a dict argument + call assert_fails("call g:Xsetlist([{}], ' ', {})", 'E475:') endfunc func Test_qf_property() diff --git a/src/version.c b/src/version.c index 9da21730d2..f1b0be6f69 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1101, +/**/ 1100, /**/ 1099, |