diff options
author | Tatsuo Ishii <ishii@postgresql.org> | 2001-02-17 10:03:33 +0000 |
---|---|---|
committer | Tatsuo Ishii <ishii@postgresql.org> | 2001-02-17 10:03:33 +0000 |
commit | 2bc2738fc48a2b776db1117e653f2784235f09b7 (patch) | |
tree | 4a5a775cc3ab59b9337ecafade3651f4a2140911 /src | |
parent | 4571439297f98f0fc041de883375229fcc355afc (diff) | |
download | postgresql-2bc2738fc48a2b776db1117e653f2784235f09b7.tar.gz postgresql-2bc2738fc48a2b776db1117e653f2784235f09b7.zip |
Fix a bug in psql. unescape() does not work for multi-byte encodings.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/command.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 34a05fa6b1c..a81f222f39d 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.46 2001/02/10 02:31:27 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.47 2001/02/17 10:03:33 ishii Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -494,7 +494,7 @@ exec_command(const char *cmd, success = false; } else - success = do_lo_import(opt1, opt2); + success = do_lo_import(opt1, opt2); } else if (strcmp(cmd + 3, "list") == 0) @@ -1166,7 +1166,13 @@ unescape(const unsigned char *source, size_t len) else { - *tmp++ = *p; + int i; + const unsigned char *mp = p; + + for (i = 0;i < PQmblen(p, pset.encoding);i++) + { + *tmp++ = *mp++; + } esc = false; } } |