os: call os.real_path/1 before returning in os.find_abs_path_of_executable/1

pull/6130/head
Delyan Angelov 2020-08-20 19:23:12 +03:00
parent 0c183da116
commit 9b171b76e0
1 changed files with 2 additions and 2 deletions

View File

@ -967,7 +967,7 @@ fn executable_fallback() string {
// the absolute path of the executable if found
pub fn find_abs_path_of_executable(exepath string) ?string {
if os.is_abs_path(exepath) {
return exepath
return os.real_path(exepath)
}
mut res := ''
env_path_delimiter := if os.user_os() == 'windows' { ';' } else { ':' }
@ -980,7 +980,7 @@ pub fn find_abs_path_of_executable(exepath string) ?string {
}
}
if res.len>0 {
return res
return os.real_path(res)
}
return error('failed to find executable')
}