0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4838: checking for absolute path is not trivial

Problem:    Checking for absolute path is not trivial.
Solution:   Add isabsolutepath(). (closes #10303)
This commit is contained in:
LemonBoy
2022-04-28 15:26:33 +01:00
committed by Bram Moolenaar
parent 68a573ce2b
commit dca1d40cd0
7 changed files with 55 additions and 0 deletions

View File

@@ -1416,6 +1416,18 @@ f_isdirectory(typval_T *argvars, typval_T *rettv)
rettv->vval.v_number = mch_isdir(tv_get_string(&argvars[0]));
}
/*
* "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.