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

another Windows fix

This commit is contained in:
Alexander Medvednikov 2019-07-16 02:06:39 +02:00
parent 090cdcf3b9
commit 9c63cac54d

View File

@ -385,7 +385,15 @@ pub fn ext(path string) string {
// dir returns all but the last element of path, typically the path's directory.
pub fn dir(path string) string {
pos := path.last_index(PathSeparator)
mut pos := -1
// TODO PathSeparator defined in os_win.v doesn't work when building V,
// because v.c is generated for a nix system.
$if windows {
pos = path.last_index('\\')
}
$else {
pos = path.last_index(PathSeparator)
}
if pos == -1 {
return '.'
}