diff --git a/tcl/Sdc.tcl b/tcl/Sdc.tcl index beee9c6e..4f0f1a75 100644 --- a/tcl/Sdc.tcl +++ b/tcl/Sdc.tcl @@ -83,7 +83,10 @@ proc source_ { filename echo verbose } { if { [string index $line end] != "\\" \ && [info complete $cmd] } { set error {} - switch [catch {uplevel \#0 $cmd} result] { + set error_code [catch {uplevel \#0 $cmd} result] + # Flush results printed outside tcl to stdout/stderr. + fflush + switch $error_code { 0 { if { $verbose && $result != "" } { puts $result } } 1 { set error $result } 2 { set error {invoked "return" outside of a proc.} } diff --git a/tcl/StaTcl.i b/tcl/StaTcl.i index c34453b6..11d31cf6 100644 --- a/tcl/StaTcl.i +++ b/tcl/StaTcl.i @@ -1911,6 +1911,13 @@ git_sha1() return STA_GIT_SHA1; } +void +fflush() +{ + fflush(stdout); + fflush(stderr); +} + void redirect_file_begin(const char *filename) {