We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent57f1630 commit506a989Copy full SHA for 506a989
src/bin/psql/input.c
@@ -3,7 +3,7 @@
3
*
4
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
5
6
- * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.60 2006/10/04 00:30:06 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.61 2006/12/24 19:14:28 tgl Exp $
7
*/
8
#include"postgres_fe.h"
9
@@ -111,6 +111,12 @@ pg_send_history(PQExpBuffer history_buf)
111
staticchar*prev_hist=NULL;
112
113
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';
120
121
if (useHistory&&s[0])
122
{
@@ -123,12 +129,6 @@ pg_send_history(PQExpBuffer history_buf)
123
129
}
124
130
else
125
131
126
-inti;
127
-
128
-/* Trim any trailing \n's (OK to scribble on history_buf) */
-for (i=strlen(s)-1;i >=0&&s[i]=='\n';i--)
-;
-s[i+1]='\0';
132
/* Save each previous line for ignoredups processing */
133
if (prev_hist)
134
free(prev_hist);