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

native: add support for print, eprint and eprintln (#11034)

This commit is contained in:
pancake
2021-08-03 15:04:31 +02:00
committed by GitHub
parent 80976e640c
commit 00d4c7082e
7 changed files with 50 additions and 13 deletions

View File

@@ -346,7 +346,7 @@ pub fn execute(cmd string) Result {
// if cmd.contains(';') || cmd.contains('&&') || cmd.contains('||') || cmd.contains('\n') {
// return Result{ exit_code: -1, output: ';, &&, || and \\n are not allowed in shell commands' }
// }
pcmd := '$cmd 2>&1'
pcmd := if cmd.contains('2>') { cmd } else { '$cmd 2>&1' }
f := vpopen(pcmd)
if isnil(f) {
return Result{