diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-12-14 04:59:58 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-12-14 04:59:58 +0000 |
commit | ffb90a01fdd97bebb1a70d7899f55765f0acfe00 (patch) | |
tree | 33134e20d6dd1cbe87ad4674eb36bc2d120a1ebb /src/backend | |
parent | 4140c2f30e2814527f0975876956f446e326ae70 (diff) | |
download | postgresql-ffb90a01fdd97bebb1a70d7899f55765f0acfe00.tar.gz postgresql-ffb90a01fdd97bebb1a70d7899f55765f0acfe00.zip |
Current multi-byte related codes have a bug with SQL_ASCII
support. Included patches will solve it and should be applied to
both trees. Also, it fix the problem with \c command of psql when
switching different encoding databases.
Regression tests passed.
--
Tatsuo Ishii
t-ishii@sra.co.jp
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/utils/mb/conv.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/mb/conv.c b/src/backend/utils/mb/conv.c index ee9649f32d9..1a4493c8e07 100644 --- a/src/backend/utils/mb/conv.c +++ b/src/backend/utils/mb/conv.c @@ -2,7 +2,7 @@ * conversion between client encoding and server internal encoding * (currently mule internal code (mic) is used) * Tatsuo Ishii - * $Id: conv.c,v 1.3 1998/09/01 04:33:21 momjian Exp $ + * $Id: conv.c,v 1.4 1998/12/14 04:59:58 momjian Exp $ */ #include <stdio.h> #include <string.h> @@ -487,7 +487,7 @@ mic2ascii(unsigned char *mic, unsigned char *p, int len) { int c1; - while (len > 0 && (c1 = *mic)) + while (len-- > 0 && (c1 = *mic)) { if (c1 > 0x7f) printBogusChar(&mic, &p); @@ -495,6 +495,7 @@ mic2ascii(unsigned char *mic, unsigned char *p, int len) { /* should be ASCII */ *p++ = c1; } + mic++; } *p = '\0'; } |