mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: let os.dir("/xyz") return "/" (fixes compiling .v files in /)
This commit is contained in:
@@ -170,6 +170,9 @@ pub fn dir(path string) string {
|
||||
return '.'
|
||||
}
|
||||
pos := path.last_index(path_separator) or { return '.' }
|
||||
if pos == 0 && path_separator == '/' {
|
||||
return '/'
|
||||
}
|
||||
return path[..pos]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user