source fflush after each cmd

This commit is contained in:
James Cherry 2020-03-08 16:58:10 -07:00
parent d615f62fe4
commit 6f088660ba
2 changed files with 11 additions and 1 deletions

View File

@ -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.} }

View File

@ -1911,6 +1911,13 @@ git_sha1()
return STA_GIT_SHA1;
}
void
fflush()
{
fflush(stdout);
fflush(stderr);
}
void
redirect_file_begin(const char *filename)
{