mirror of
https://gitlab.com/80486DX2-66/gists
synced 2024-12-28 00:00:18 +05:30
freadln.c: flush stdout only if file is stdin
This commit is contained in:
parent
d7be00df1f
commit
ec06d2165b
@ -31,7 +31,8 @@ int freadln(FILE* f, char** output, size_t* length_out) {
|
|||||||
|
|
||||||
// NOTE: if the file is STDIN, flush STDOUT before waiting for input to
|
// NOTE: if the file is STDIN, flush STDOUT before waiting for input to
|
||||||
// make sure a prompt is displayed
|
// make sure a prompt is displayed
|
||||||
fflush(stdout);
|
if (f == stdin)
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
freadln_length_type length = 0; // initial length
|
freadln_length_type length = 0; // initial length
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user