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

Commit506a989

Browse files
committed
Make HISTCONTROL=ignoredups work again (broken by misordering of
operations during recent code refactoring). Per bug #2840 from Ned Crigler.
1 parent57f1630 commit506a989

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/bin/psql/input.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.60 2006/10/04 00:30:06 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.61 2006/12/24 19:14:28 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99

@@ -111,6 +111,12 @@ pg_send_history(PQExpBuffer history_buf)
111111
staticchar*prev_hist=NULL;
112112

113113
char*s=history_buf->data;
114+
inti;
115+
116+
/* Trim any trailing \n's (OK to scribble on history_buf) */
117+
for (i=strlen(s)-1;i >=0&&s[i]=='\n';i--)
118+
;
119+
s[i+1]='\0';
114120

115121
if (useHistory&&s[0])
116122
{
@@ -123,12 +129,6 @@ pg_send_history(PQExpBuffer history_buf)
123129
}
124130
else
125131
{
126-
inti;
127-
128-
/* Trim any trailing \n's (OK to scribble on history_buf) */
129-
for (i=strlen(s)-1;i >=0&&s[i]=='\n';i--)
130-
;
131-
s[i+1]='\0';
132132
/* Save each previous line for ignoredups processing */
133133
if (prev_hist)
134134
free(prev_hist);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp