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

cgen: optionals fixes

This commit is contained in:
Alexander Medvednikov
2020-03-13 12:22:36 +01:00
parent e667e72685
commit 973b5c226a
2 changed files with 9 additions and 8 deletions

View File

@ -626,11 +626,11 @@ pub fn dir(path string) string {
}
pub fn base_dir(path string) string {
pos := path.last_index(path_separator) or {
posx := path.last_index(path_separator) or {
return path
}
// NB: *without* terminating /
return path[..pos]
return path[..posx]
}
pub fn filename(path string) string {