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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user