diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-01-21 22:05:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-01-21 22:05:53 +0000 |
commit | 5a2a8b9e01e83e68c6cbcffc2259f5dad4f108be (patch) | |
tree | 055a9548f5bce53ce2072af43195869999c0a4dc | |
parent | ab65429adf497e77cdf73305974c37373a534205 (diff) | |
download | postgresql-5a2a8b9e01e83e68c6cbcffc2259f5dad4f108be.tar.gz postgresql-5a2a8b9e01e83e68c6cbcffc2259f5dad4f108be.zip |
Ensure fflush(stdout) happens in all cases, per gripe from Jon Sablatnig.
-rw-r--r-- | src/bin/psql/mainloop.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index 0468a8ec469..c2001eb8f6e 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.57 2003/08/04 23:59:40 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.57.4.1 2004/01/21 22:05:53 tgl Exp $ */ #include "postgres_fe.h" #include "mainloop.h" @@ -103,7 +103,6 @@ MainLoop(FILE *source) } cancel_pressed = false; - fflush(stdout); } #ifndef WIN32 @@ -122,7 +121,6 @@ MainLoop(FILE *source) paren_level = 0; count_eof = 0; slashCmdStatus = CMD_UNKNOWN; - fflush(stdout); } else { @@ -138,6 +136,8 @@ MainLoop(FILE *source) pqsignal(SIGINT, handle_sigint); /* control-C => cancel */ #endif /* not WIN32 */ + fflush(stdout); + if (slashCmdStatus == CMD_NEWEDIT) { /* @@ -161,8 +161,6 @@ MainLoop(FILE *source) { int prompt_status; - fflush(stdout); - if (in_quote && in_quote == '\'') prompt_status = PROMPT_SINGLEQUOTE; else if (in_quote && in_quote == '"') @@ -181,7 +179,6 @@ MainLoop(FILE *source) else line = gets_fromFile(source); - /* Setting this will not have effect until next line. */ die_on_error = GetVariableBool(pset.vars, "ON_ERROR_STOP"); |