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

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

This commit is contained in:
Delyan Angelov 2020-08-20 19:23:12 +03:00
parent 0c183da116
commit 9b171b76e0

View File

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