提交 d0928a3a 编写于 作者: B Bruce Momjian

Fix \e for empty file.

上级 d0471244
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.109 1997/11/17 05:23:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.110 1997/11/17 17:54:24 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2099,7 +2099,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) ...@@ -2099,7 +2099,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
* for next command * for next command
*/ */
if (line == NULL || *line == '\0') if (line == NULL || (!interactive && *line == '\0'))
{ /* No more input. Time to quit, or \i done */ { /* No more input. Time to quit, or \i done */
if (!pset->quiet) if (!pset->quiet)
printf("EOF\n");/* Goes on prompt line */ printf("EOF\n");/* Goes on prompt line */
...@@ -2127,6 +2127,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) ...@@ -2127,6 +2127,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
if (!interactive && !pset->singleStep && !pset->quiet) if (!interactive && !pset->singleStep && !pset->quiet)
fprintf(stderr, "%s\n", line); fprintf(stderr, "%s\n", line);
slashCmdStatus = CMD_UNKNOWN;
/* nothing on line after trimming? then ignore */ /* nothing on line after trimming? then ignore */
if (line[0] == '\0') if (line[0] == '\0')
{ {
...@@ -2265,7 +2266,6 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) ...@@ -2265,7 +2266,6 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
continue; continue;
} }
slashCmdStatus = CMD_UNKNOWN;
if (!in_quote && query_start[0] == '\\') if (!in_quote && query_start[0] == '\\')
{ {
slashCmdStatus = HandleSlashCmds(pset, slashCmdStatus = HandleSlashCmds(pset,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册