Skip to content
Snippets Groups Projects
Commit 4d2e94ef authored by Tom Lane's avatar Tom Lane
Browse files

Ensure fflush(stdout) happens in all cases, per gripe from Jon Sablatnig.

parent ecb156d4
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2003, PostgreSQL Global Development Group * Copyright (c) 2000-2003, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.58 2003/11/29 19:52:06 pgsql Exp $ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.59 2004/01/21 22:05:44 tgl Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "mainloop.h" #include "mainloop.h"
...@@ -103,7 +103,6 @@ MainLoop(FILE *source) ...@@ -103,7 +103,6 @@ MainLoop(FILE *source)
} }
cancel_pressed = false; cancel_pressed = false;
fflush(stdout);
} }
#ifndef WIN32 #ifndef WIN32
...@@ -122,7 +121,6 @@ MainLoop(FILE *source) ...@@ -122,7 +121,6 @@ MainLoop(FILE *source)
paren_level = 0; paren_level = 0;
count_eof = 0; count_eof = 0;
slashCmdStatus = CMD_UNKNOWN; slashCmdStatus = CMD_UNKNOWN;
fflush(stdout);
} }
else else
{ {
...@@ -138,6 +136,8 @@ MainLoop(FILE *source) ...@@ -138,6 +136,8 @@ MainLoop(FILE *source)
pqsignal(SIGINT, handle_sigint); /* control-C => cancel */ pqsignal(SIGINT, handle_sigint); /* control-C => cancel */
#endif /* not WIN32 */ #endif /* not WIN32 */
fflush(stdout);
if (slashCmdStatus == CMD_NEWEDIT) if (slashCmdStatus == CMD_NEWEDIT)
{ {
/* /*
...@@ -161,8 +161,6 @@ MainLoop(FILE *source) ...@@ -161,8 +161,6 @@ MainLoop(FILE *source)
{ {
int prompt_status; int prompt_status;
fflush(stdout);
if (in_quote && in_quote == '\'') if (in_quote && in_quote == '\'')
prompt_status = PROMPT_SINGLEQUOTE; prompt_status = PROMPT_SINGLEQUOTE;
else if (in_quote && in_quote == '"') else if (in_quote && in_quote == '"')
...@@ -181,7 +179,6 @@ MainLoop(FILE *source) ...@@ -181,7 +179,6 @@ MainLoop(FILE *source)
else else
line = gets_fromFile(source); line = gets_fromFile(source);
/* Setting this will not have effect until next line. */ /* Setting this will not have effect until next line. */
die_on_error = GetVariableBool(pset.vars, "ON_ERROR_STOP"); die_on_error = GetVariableBool(pset.vars, "ON_ERROR_STOP");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment