print: handle mixing stdout and stderr printing

Fixes regression from commit 5ba27c90 which caused stdio
buffering issues now that output is split to stderr/stdout.

See also commit 51737872 for some of the history.

Fixes #7107
cute-signatures
Timo Teräs 2017-04-26 09:34:32 +03:00
parent f3a4272a02
commit 027df02dc2
1 changed files with 2 additions and 0 deletions

View File

@ -159,6 +159,8 @@ const char *apk_error_str(int error)
static void log_internal(FILE *dest, const char *prefix, const char *format, va_list va)
{
if (dest != stdout)
fflush(stdout);
if (prefix != NULL)
fprintf(dest, "%s", prefix);
vfprintf(dest, format, va);