summaryrefslogtreecommitdiff
path: root/src/bin/psql/common.c
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2004-03-15 10:41:26 +0000
committerTatsuo Ishii <ishii@postgresql.org>2004-03-15 10:41:26 +0000
commite8c32050371d06c0f61fed02acc554fe7a7e8c66 (patch)
treeeac210624a8f5b14c2aceafbe3ccae3d44172d7e /src/bin/psql/common.c
parent1bc2d544b979164a276f9e6052f0b6d23af59b60 (diff)
Add PQmbdsplen() which returns the "display length" of a character.
Still some works needed: - UTF-8, MULE_INTERNAL always returns 1
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r--src/bin/psql/common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 511107b575d..2a6be545caf 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.83 2004/03/14 04:25:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.84 2004/03/15 10:41:26 ishii Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -410,7 +410,7 @@ ReportSyntaxErrorPosition(const PGresult *result, const char *query)
{
qidx[i] = qoffset;
scridx[i] = scroffset;
- scroffset += 1; /* XXX fix me when we have screen width info */
+ scroffset += PQdsplen(&query[qoffset], pset.encoding);
qoffset += PQmblen(&query[qoffset], pset.encoding);
}
qidx[i] = qoffset;
@@ -526,7 +526,7 @@ ReportSyntaxErrorPosition(const PGresult *result, const char *query)
scroffset = 0;
for (i = 0; i < msg.len; i += PQmblen(&msg.data[i], pset.encoding))
{
- scroffset += 1; /* XXX fix me when we have screen width info */
+ scroffset += PQdsplen(&msg.data[i], pset.encoding);
}
/* Finish and emit the message. */