diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-04-28 15:26:33 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-28 15:26:33 +0100 |
commit | dca1d40cd0f2af0755519e7028378bd3c8fefd31 (patch) | |
tree | 3c045bcc898b033399fd9d5fe4ec884ef70c58e2 /src/filepath.c | |
parent | 68a573ce2b996602a86b14d9b258ebb8c657604f (diff) |
patch 8.2.4838: checking for absolute path is not trivialv8.2.4838
Problem: Checking for absolute path is not trivial.
Solution: Add isabsolutepath(). (closes #10303)
Diffstat (limited to 'src/filepath.c')
-rw-r--r-- | src/filepath.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/filepath.c b/src/filepath.c index 1bde4200d3..6ee5fad960 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -1417,6 +1417,18 @@ f_isdirectory(typval_T *argvars, typval_T *rettv) } /* + * "isabsolutepath()" function + */ + void +f_isabsolutepath(typval_T *argvars, typval_T *rettv) +{ + if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL) + return; + + rettv->vval.v_number = mch_isFullName(tv_get_string_strict(&argvars[0])); +} + +/* * Create the directory in which "dir" is located, and higher levels when * needed. * Return OK or FAIL. |