diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-12 21:22:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-12 21:22:31 +0100 |
commit | 64ed4d4398e92ac56a9bbd66d5ec992dd4c335f7 (patch) | |
tree | 4c44133ad50b219b2b2cf34d82eb7f787717dd7c /src/evalfunc.c | |
parent | 67876de7bbc4254268d8180d68203b965e25ed95 (diff) | |
download | vim-git-64ed4d4398e92ac56a9bbd66d5ec992dd4c335f7.tar.gz |
patch 8.2.2338: Vim9: no error if using job_info() result wronglyv8.2.2338
Problem: Vim9: no error if using job_info() result wrongly.
Solution: Adjust return type on number of arguments. (closes #7667)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 0d17b9ed7..65cb59f8d 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -472,6 +472,13 @@ ret_dict_any(int argcount UNUSED, type_T **argtypes UNUSED) return &t_dict_any; } static type_T * +ret_job_info(int argcount, type_T **argtypes UNUSED) +{ + if (argcount == 0) + return &t_list_job; + return &t_dict_any; +} + static type_T * ret_dict_number(int argcount UNUSED, type_T **argtypes UNUSED) { return &t_dict_number; @@ -1100,7 +1107,7 @@ static funcentry_T global_functions[] = {"job_getchannel", 1, 1, FEARG_1, NULL, ret_channel, JOB_FUNC(f_job_getchannel)}, {"job_info", 0, 1, FEARG_1, NULL, - ret_dict_any, JOB_FUNC(f_job_info)}, + ret_job_info, JOB_FUNC(f_job_info)}, {"job_setoptions", 2, 2, FEARG_1, NULL, ret_void, JOB_FUNC(f_job_setoptions)}, {"job_start", 1, 2, FEARG_1, NULL, |