aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/mainloop.c
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2000-01-15 05:38:50 +0000
committerTatsuo Ishii <ishii@postgresql.org>2000-01-15 05:38:50 +0000
commitbfbd58ce131c527d04911dac59feaf28876cf4cf (patch)
tree74f43028cefc4253e133b0317305691684a1d36d /src/bin/psql/mainloop.c
parent8fc386a2d830c94dbf990e97297cb9ae75fa4453 (diff)
downloadpostgresql-bfbd58ce131c527d04911dac59feaf28876cf4cf.tar.gz
postgresql-bfbd58ce131c527d04911dac59feaf28876cf4cf.zip
Adapt to the changes of libpq(eliminateing using putenv()).
Diffstat (limited to 'src/bin/psql/mainloop.c')
-rw-r--r--src/bin/psql/mainloop.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index 919025cb5c4..6380b674fdc 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -25,7 +25,7 @@
* FIXME: rewrite this whole thing with flex
*/
int
-MainLoop(FILE *source)
+MainLoop(FILE *source, int encoding)
{
PQExpBuffer query_buf; /* buffer for query being accumulated */
PQExpBuffer previous_buf; /* if there isn't anything in the new buffer
@@ -212,10 +212,10 @@ MainLoop(FILE *source)
* The current character is at line[i], the prior character at line[i
* - prevlen], the next character at line[i + thislen].
*/
-#define ADVANCE_1 (prevlen = thislen, i += thislen, thislen = PQmblen(line+i))
+#define ADVANCE_1 (prevlen = thislen, i += thislen, thislen = PQmblen(line+i, encoding))
success = true;
- for (i = 0, prevlen = 0, thislen = (len > 0) ? PQmblen(line) : 0;
+ for (i = 0, prevlen = 0, thislen = (len > 0) ? PQmblen(line, encoding) : 0;
i < len;
ADVANCE_1)
{
@@ -373,7 +373,7 @@ MainLoop(FILE *source)
/* handle backslash command */
slashCmdStatus = HandleSlashCmds(&line[i],
query_buf->len>0 ? query_buf : previous_buf,
- &end_of_cmd);
+ &end_of_cmd, encoding);
success = slashCmdStatus != CMD_ERROR;