comparison src/filepath.c @ 28629:5ef46b938c6e v8.2.4838

patch 8.2.4838: checking for absolute path is not trivial Commit: https://github.com/vim/vim/commit/dca1d40cd0f2af0755519e7028378bd3c8fefd31 Author: LemonBoy <thatlemon@gmail.com> Date: Thu Apr 28 15:26:33 2022 +0100 patch 8.2.4838: checking for absolute path is not trivial Problem: Checking for absolute path is not trivial. Solution: Add isabsolutepath(). (closes https://github.com/vim/vim/issues/10303)
author Bram Moolenaar <Bram@vim.org>
date Thu, 28 Apr 2022 16:30:03 +0200
parents 62cc3b60493b
children dfe18756f2ad
comparison
equal deleted inserted replaced
28628:5cb27da6a351 28629:5ef46b938c6e
1415 1415
1416 rettv->vval.v_number = mch_isdir(tv_get_string(&argvars[0])); 1416 rettv->vval.v_number = mch_isdir(tv_get_string(&argvars[0]));
1417 } 1417 }
1418 1418
1419 /* 1419 /*
1420 * "isabsolutepath()" function
1421 */
1422 void
1423 f_isabsolutepath(typval_T *argvars, typval_T *rettv)
1424 {
1425 if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
1426 return;
1427
1428 rettv->vval.v_number = mch_isFullName(tv_get_string_strict(&argvars[0]));
1429 }
1430
1431 /*
1420 * Create the directory in which "dir" is located, and higher levels when 1432 * Create the directory in which "dir" is located, and higher levels when
1421 * needed. 1433 * needed.
1422 * Return OK or FAIL. 1434 * Return OK or FAIL.
1423 */ 1435 */
1424 static int 1436 static int