mirror of
https://github.com/vlang/v.git
synced 2025-08-04 10:17:22 -04:00
os: flush stdout and stderr before calling _wsystem (on windows), as the MSDN doc advices (#20034)
This commit is contained in:
parent
74c59abf4e
commit
dc3ea0f87f
@ -400,6 +400,8 @@ pub fn system(cmd string) int {
|
|||||||
// overcome bug in system & _wsystem (cmd) when first char is quote `"`
|
// overcome bug in system & _wsystem (cmd) when first char is quote `"`
|
||||||
wcmd := if cmd.len > 1 && cmd[0] == `"` && cmd[1] != `"` { '"${cmd}"' } else { cmd }
|
wcmd := if cmd.len > 1 && cmd[0] == `"` && cmd[1] != `"` { '"${cmd}"' } else { cmd }
|
||||||
unsafe {
|
unsafe {
|
||||||
|
C.fflush(C.stdout)
|
||||||
|
C.fflush(C.stderr)
|
||||||
ret = C._wsystem(wcmd.to_wide())
|
ret = C._wsystem(wcmd.to_wide())
|
||||||
}
|
}
|
||||||
} $else {
|
} $else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user