1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

os: fix is_abs_path function for Windows systems (#14397)

This commit is contained in:
Ben
2022-05-16 08:59:37 +02:00
committed by GitHub
parent 7fe3ef9a6e
commit cbb24d34c9
4 changed files with 115 additions and 20 deletions

View File

@ -454,18 +454,6 @@ pub fn is_file(path string) bool {
return exists(path) && !is_dir(path)
}
// is_abs_path returns `true` if `path` is absolute.
pub fn is_abs_path(path string) bool {
if path.len == 0 {
return false
}
$if windows {
return path[0] == `/` || // incase we're in MingGW bash
(path[0].is_letter() && path.len > 1 && path[1] == `:`)
}
return path[0] == `/`
}
// join_path returns a path as string from input string parameter(s).
[manualfree]
pub fn join_path(base string, dirs ...string) string {