summaryrefslogtreecommitdiff
path: root/src/list.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-23 13:17:47 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-23 13:17:47 +0000
commit2007dd49f5cb36f944cab1cfbceb0f864e625f74 (patch)
tree3269837fb87102d6de40418d1b4ecf7345a43c93 /src/list.c
parent6a8b13614e5bcb233d20403ae9f008ccba152be3 (diff)
downloadvim-git-2007dd49f5cb36f944cab1cfbceb0f864e625f74.tar.gz
patch 8.2.4455: accepting one and zero for second sort() argument is strangev8.2.4455
Problem: Accepting one and zero for the second sort() argument is strange. Solution: Disallow using one and zero in Vim9 script.
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/list.c b/src/list.c
index 578d6f115..88f310253 100644
--- a/src/list.c
+++ b/src/list.c
@@ -2198,7 +2198,8 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
if (in_vim9script()
&& (check_for_list_arg(argvars, 0) == FAIL
|| (argvars[1].v_type != VAR_UNKNOWN
- && check_for_opt_dict_arg(argvars, 2) == FAIL)))
+ && (check_for_string_or_func_arg(argvars, 1) == FAIL
+ || check_for_opt_dict_arg(argvars, 2) == FAIL))))
return;
if (argvars[0].v_type != VAR_LIST)