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

fix vtool used with paths w/spaces (win/nix)

This commit is contained in:
joe-conigliaro
2019-11-17 22:36:05 +11:00
committed by Alexander Medvednikov
parent 43863edc4f
commit 6d7fe1f83c
2 changed files with 6 additions and 5 deletions

View File

@ -399,7 +399,9 @@ pub fn system(cmd string) int {
}
mut ret := int(0)
$if windows {
ret = C._wsystem(cmd.to_wide())
// overcome bug in system & _wsystem (cmd) when first char is quote `"`
wcmd := if cmd.len > 1 && cmd[0] == `"` && cmd[1] != `"` { '"$cmd"' } else { cmd }
ret = C._wsystem(wcmd.to_wide())
} $else {
ret = C.system(cmd.str)
}