diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-12 18:58:40 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-12 18:58:40 +0100 |
commit | 2a9d5d386bea8455b37c1accebc45683ec51d6fb (patch) | |
tree | e5e67a60b0741486ce6e53fe76ca3669a9f7e752 /src/filepath.c | |
parent | 3ae50c775c00b098cdfc9e90b17c4cc07f00e08d (diff) |
patch 8.2.2133: Vim9: checking for a non-empty string is too strictv8.2.2133
Problem: Vim9: checking for a non-empty string is too strict.
Solution: Check for any string. (closes #7447)
Diffstat (limited to 'src/filepath.c')
-rw-r--r-- | src/filepath.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/filepath.c b/src/filepath.c index 89fafe3134..347612a802 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -876,7 +876,7 @@ f_exepath(typval_T *argvars, typval_T *rettv) { char_u *p = NULL; - if (in_vim9script() && check_for_string(&argvars[0]) == FAIL) + if (in_vim9script() && check_for_nonempty_string(&argvars[0]) == FAIL) return; (void)mch_can_exe(tv_get_string(&argvars[0]), &p, TRUE); rettv->v_type = VAR_STRING; @@ -942,7 +942,7 @@ findfilendir( rettv->vval.v_string = NULL; rettv->v_type = VAR_STRING; - if (in_vim9script() && check_for_string(&argvars[0]) == FAIL) + if (in_vim9script() && check_for_nonempty_string(&argvars[0]) == FAIL) return; #ifdef FEAT_SEARCHPATH @@ -1028,9 +1028,9 @@ f_fnamemodify(typval_T *argvars, typval_T *rettv) return; fname = tv_get_string_chk(&argvars[0]); mods = tv_get_string_buf_chk(&argvars[1], buf); - if (fname == NULL || mods == NULL) + if (fname == NULL) fname = NULL; - else + else if (mods != NULL && *mods != NUL) { len = (int)STRLEN(fname); (void)modify_fname(mods, FALSE, &usedlen, &fname, &fbuf, &len); |