File tree 1 file changed +5
-3
lines changed 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright 2000 by PostgreSQL Global Development Group
5
5
*
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 $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "mainloop.h"
@@ -447,7 +447,6 @@ MainLoop(FILE *source)
447
447
{
448
448
const char * end_of_cmd = NULL ;
449
449
450
- paren_level = 0 ;
451
450
line [i - prevlen ] = '\0' ; /* overwrites backslash */
452
451
453
452
/* is there anything else on the line for the command? */
@@ -473,7 +472,7 @@ MainLoop(FILE *source)
473
472
if ((slashCmdStatus == CMD_SEND || slashCmdStatus == CMD_NEWEDIT ) &&
474
473
query_buf -> len == 0 )
475
474
{
476
- /* copy previous buffer to current for for handling */
475
+ /* copy previous buffer to current for handling */
477
476
appendPQExpBufferStr (query_buf , previous_buf -> data );
478
477
}
479
478
@@ -487,6 +486,9 @@ MainLoop(FILE *source)
487
486
resetPQExpBuffer (query_buf );
488
487
}
489
488
489
+ if (query_buf -> len == 0 && previous_buf -> len == 0 )
490
+ paren_level = 0 ;
491
+
490
492
/* process anything left after the backslash command */
491
493
i += end_of_cmd - & line [i ];
492
494
query_start = i ;
You can’t perform that action at this time.
0 commit comments