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

Commitd2202a6

Browse files
committed
Don't elide blank lines when accumulating psql command history.
This can change the meaning of queries, if the blank line happens tooccur in the middle of a quoted literal, as per complaint from Tomas Vondra.Back-patch to all supported branches.
1 parent003fae7 commitd2202a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/bin/psql/input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ void
8686
pg_append_history(constchar*s,PQExpBufferhistory_buf)
8787
{
8888
#ifdefUSE_READLINE
89-
if (useHistory&&s&&s[0])
89+
if (useHistory&&s)
9090
{
9191
appendPQExpBufferStr(history_buf,s);
92-
if (s[strlen(s)-1]!='\n')
92+
if (!s[0]||s[strlen(s)-1]!='\n')
9393
appendPQExpBufferChar(history_buf,'\n');
9494
}
9595
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp