summaryrefslogtreecommitdiff
path: root/src/core/wee-command.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-07-25 09:16:08 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-07-25 09:16:08 +0200
commit7572fec26150d4097ae448af9d265cd5ce39ccc3 (patch)
treec29391cdfc6c7c39e8d11fde282ea2205e2b85e5 /src/core/wee-command.c
parentb99a6307051d00d9fcece0588d382e2fb62c193f (diff)
downloadweechat-7572fec26150d4097ae448af9d265cd5ce39ccc3.zip
core: flush stdout/stderr after sending text directly on them (fix corrupted data sent to hook_process() callback) (closes #442)
Diffstat (limited to 'src/core/wee-command.c')
-rw-r--r--src/core/wee-command.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 215abee75..ef1ce1db1 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -4607,6 +4607,7 @@ COMMAND_CALLBACK(print)
else if (string_strcasecmp (argv[i], "-beep") == 0)
{
fprintf (stderr, "\a");
+ fflush (stderr);
return WEECHAT_RC_OK;
}
else if (argv[i][0] == '-')
@@ -4632,6 +4633,7 @@ COMMAND_CALLBACK(print)
if (text)
{
fprintf ((to_stdout) ? stdout : stderr, "%s", text);
+ fflush ((to_stdout) ? stdout : stderr);
free (text);
}
}