Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb8e3f1

Browse files
committed
Add code to preserve paren level display after \g, as submitted months ago.
1 parentc03e7fb commitfb8e3f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/bin/psql/mainloop.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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
constchar*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 forforhandling */
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;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp