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

Commitff4fd4b

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 parent04da323 commitff4fd4b

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
@@ -95,10 +95,10 @@ void
9595
pg_append_history(constchar*s,PQExpBufferhistory_buf)
9696
{
9797
#ifdefUSE_READLINE
98-
if (useHistory&&s&&s[0])
98+
if (useHistory&&s)
9999
{
100100
appendPQExpBufferStr(history_buf,s);
101-
if (s[strlen(s)-1]!='\n')
101+
if (!s[0]||s[strlen(s)-1]!='\n')
102102
appendPQExpBufferChar(history_buf,'\n');
103103
}
104104
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp