Skip to content

Commit d0928a3

Browse files
committed
Fix \e for empty file.
1 parent d047124 commit d0928a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/psql/psql.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.109 1997/11/17 05:23:11 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.110 1997/11/17 17:54:24 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -2099,7 +2099,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
20992099
* for next command
21002100
*/
21012101

2102-
if (line == NULL || *line == '\0')
2102+
if (line == NULL || (!interactive && *line == '\0'))
21032103
{ /* No more input. Time to quit, or \i done */
21042104
if (!pset->quiet)
21052105
printf("EOF\n");/* Goes on prompt line */
@@ -2127,6 +2127,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
21272127
if (!interactive && !pset->singleStep && !pset->quiet)
21282128
fprintf(stderr, "%s\n", line);
21292129

2130+
slashCmdStatus = CMD_UNKNOWN;
21302131
/* nothing on line after trimming? then ignore */
21312132
if (line[0] == '\0')
21322133
{
@@ -2265,7 +2266,6 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
22652266
continue;
22662267
}
22672268

2268-
slashCmdStatus = CMD_UNKNOWN;
22692269
if (!in_quote && query_start[0] == '\\')
22702270
{
22712271
slashCmdStatus = HandleSlashCmds(pset,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy