File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 33 *
44 * Copyright 2000 by PostgreSQL Global Development Group
55 *
6- * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.45 2001/12/28 05:01:05 momjian Exp $
6+ * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.46 2002/02/18 05:57:41 momjian Exp $
77 */
88#include "postgres_fe.h"
99#include "mainloop.h"
@@ -447,7 +447,6 @@ MainLoop(FILE *source)
447447 {
448448 const char * end_of_cmd = NULL ;
449449
450- paren_level = 0 ;
451450 line [i - prevlen ] = '\0' ; /* overwrites backslash */
452451
453452 /* is there anything else on the line for the command? */
@@ -473,7 +472,7 @@ MainLoop(FILE *source)
473472 if ((slashCmdStatus == CMD_SEND || slashCmdStatus == CMD_NEWEDIT ) &&
474473 query_buf -> len == 0 )
475474 {
476- /* copy previous buffer to current for for handling */
475+ /* copy previous buffer to current for handling */
477476 appendPQExpBufferStr (query_buf , previous_buf -> data );
478477 }
479478
@@ -487,6 +486,9 @@ MainLoop(FILE *source)
487486 resetPQExpBuffer (query_buf );
488487 }
489488
489+ if (query_buf -> len == 0 && previous_buf -> len == 0 )
490+ paren_level = 0 ;
491+
490492 /* process anything left after the backslash command */
491493 i += end_of_cmd - & line [i ];
492494 query_start = i ;
You can’t perform that action at this time.
0 commit comments