aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/mainloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/mainloop.c')
-rw-r--r--src/bin/psql/mainloop.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index 5a8c96863d7..dcb5e4ac0ab 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.85 2007/01/05 22:19:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.86 2007/11/28 09:17:46 petere Exp $
*/
#include "postgres_fe.h"
#include "mainloop.h"
@@ -129,7 +129,11 @@ MainLoop(FILE *source)
line = gets_interactive(get_prompt(prompt_status));
}
else
+ {
line = gets_fromFile(source);
+ if (!line && ferror(source))
+ successResult = EXIT_FAILURE;
+ }
/*
* query_buf holds query already accumulated. line is the malloc'd