v.builder: add os.quoted_path() to os.system calls using v.pref.out_name, for the compress flag (fix #23685) (#23686)

This commit is contained in:
Larsimusrex 2025-02-10 20:53:09 +01:00 committed by GitHub
parent f053f99406
commit b94da8a6e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -810,16 +810,16 @@ pub fn (mut v Builder) cc() {
break
}
if v.pref.compress {
ret := os.system('strip ${v.pref.out_name}')
ret := os.system('strip ${os.quoted_path(v.pref.out_name)}')
if ret != 0 {
println('strip failed')
return
}
// Note: upx --lzma can sometimes fail with NotCompressibleException
// See https://github.com/vlang/v/pull/3528
mut ret2 := os.system('upx --lzma -qqq ${v.pref.out_name}')
mut ret2 := os.system('upx --lzma -qqq ${os.quoted_path(v.pref.out_name)}')
if ret2 != 0 {
ret2 = os.system('upx -qqq ${v.pref.out_name}')
ret2 = os.system('upx -qqq ${os.quoted_path(v.pref.out_name)}')
}
if ret2 != 0 {
println('upx failed')