diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-12 01:01:18 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-12 01:01:18 +0200 |
commit | 5959a6979fb4fb5b409edab525774b74a37d6f8e (patch) | |
tree | 737c9571a90e6e1f07be30d8bdc64c2f06d6fbf3 /strings | |
parent | 4528a2d93c0f4765863df91c3e4bbfdfc6b7c396 (diff) | |
parent | bfc6fa8c94f550f311b00c0d63372f3b75cf4b9b (diff) | |
download | mariadb-git-5959a6979fb4fb5b409edab525774b74a37d6f8e.tar.gz |
5.3 merge
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-utf8.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 88bab1fac76..b113d9f3b92 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -4353,6 +4353,10 @@ static const char filename_safe_char[128]= #define MY_FILENAME_ESCAPE '@' +/* + note, that we cannot trust 'e' here, it's may be fake, + see strconvert() +*/ static int my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e) @@ -4374,7 +4378,7 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), return MY_CS_TOOSMALL3; byte1= s[1]; - byte2= s[2]; + byte2= byte1 ? s[2] : 0; if (byte1 >= 0x30 && byte1 <= 0x7F && byte2 >= 0x30 && byte2 <= 0x7F) @@ -4399,7 +4403,7 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), (byte2= hexlo(byte2)) >= 0) { int byte3= hexlo(s[3]); - int byte4= hexlo(s[4]); + int byte4= hexlo(s[3] ? s[4] : 0); if (byte3 >=0 && byte4 >=0) { *pwc= (byte1 << 12) + (byte2 << 8) + (byte3 << 4) + byte4; |