summaryrefslogtreecommitdiffstats
path: root/src/filepath.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-03-27 21:23:30 +0100
committerBram Moolenaar <Bram@vim.org>2021-03-27 21:23:30 +0100
commitc580943965fc9b006ec233bdee4ea5380f5594ea (patch)
treef17d1e9bbebd06aac239d16dd6d16fc1ecfc88e1 /src/filepath.c
parent7b45d46cf7db0d2d7a4defc2d81b233a2c672b74 (diff)
patch 8.2.2666: Vim9: not enough function arguments checked for stringv8.2.2666
Problem: Vim9: not enough function arguments checked for string. Solution: Check in ch_logfile(), char2nr() and others.
Diffstat (limited to 'src/filepath.c')
-rw-r--r--src/filepath.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 75662b485c..e81eeb1200 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -788,9 +788,13 @@ f_chdir(typval_T *argvars, typval_T *rettv)
rettv->vval.v_string = NULL;
if (argvars[0].v_type != VAR_STRING)
+ {
// Returning an empty string means it failed.
// No error message, for historic reasons.
+ if (in_vim9script())
+ (void) check_for_string_arg(argvars, 0);
return;
+ }
// Return the current directory
cwd = alloc(MAXPATHL);