Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2bc2738

Browse files
committed
Fix a bug in psql. unescape() does not work for multi-byte encodings.
1 parent4571439 commit2bc2738

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/bin/psql/command.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.46 2001/02/10 02:31:27 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.47 2001/02/17 10:03:33 ishii Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
@@ -494,7 +494,7 @@ exec_command(const char *cmd,
494494
success= false;
495495
}
496496
else
497-
success=do_lo_import(opt1,opt2);
497+
success=do_lo_import(opt1,opt2);
498498
}
499499

500500
elseif (strcmp(cmd+3,"list")==0)
@@ -1166,7 +1166,13 @@ unescape(const unsigned char *source, size_t len)
11661166

11671167
else
11681168
{
1169-
*tmp++=*p;
1169+
inti;
1170+
constunsignedchar*mp=p;
1171+
1172+
for (i=0;i<PQmblen(p,pset.encoding);i++)
1173+
{
1174+
*tmp++=*mp++;
1175+
}
11701176
esc= false;
11711177
}
11721178
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp