Mercurial > vim
changeset 22051:342bcb9f7d34 v8.2.1575
patch 8.2.1575: Vim9: globpath() doesnot take "true" as argument
Commit: https://github.com/vim/vim/commit/f966ce5ea24748eed10f708d4f828be44887a559
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 2 21:57:07 2020 +0200
patch 8.2.1575: Vim9: globpath() doesnot take "true" as argument
Problem: Vim9: globpath() doesnot take "true" as argument.
Solution: Use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6821)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 02 Sep 2020 22:00:06 +0200 |
parents | d0c7c35084c5 |
children | ca8884cbf94b |
files | src/filepath.c src/testdir/test_vim9_func.vim src/version.c |
diffstat | 3 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/filepath.c +++ b/src/filepath.c @@ -1241,14 +1241,14 @@ f_globpath(typval_T *argvars, typval_T * rettv->v_type = VAR_STRING; if (argvars[2].v_type != VAR_UNKNOWN) { - if (tv_get_number_chk(&argvars[2], &error)) + if (tv_get_bool_chk(&argvars[2], &error)) flags |= WILD_KEEP_ALL; if (argvars[3].v_type != VAR_UNKNOWN) { - if (tv_get_number_chk(&argvars[3], &error)) + if (tv_get_bool_chk(&argvars[3], &error)) rettv_list_set(rettv, NULL); if (argvars[4].v_type != VAR_UNKNOWN - && tv_get_number_chk(&argvars[4], &error)) + && tv_get_bool_chk(&argvars[4], &error)) flags |= WILD_ALLLINKS; } }
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1513,6 +1513,10 @@ def Test_glob() assert_equal(['runtest.vim'], glob('runtest.vim', true, true, true)) enddef +def Test_globpath() + assert_equal(['./runtest.vim'], globpath('.', 'runtest.vim', true, true, true)) +enddef + def Test_recursive_call() assert_equal(6765, Fibonacci(20)) enddef