diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-23 13:17:47 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-23 13:17:47 +0000 |
commit | 2007dd49f5cb36f944cab1cfbceb0f864e625f74 (patch) | |
tree | 3269837fb87102d6de40418d1b4ecf7345a43c93 /src/list.c | |
parent | 6a8b13614e5bcb233d20403ae9f008ccba152be3 (diff) | |
download | vim-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.c | 3 |
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) |