diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-11 19:30:59 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-11 19:30:59 +0200 |
commit | 61ed0ebe7388d8302f2de7144de41da32bf085ba (patch) | |
tree | 8b47861aeeef1db8fcbf8d0a558043aab93187a8 /strings | |
parent | 48be80cd95c9121d2730ebcd1df2a1a37fe73f3d (diff) | |
parent | 7b55b59b5792d87dedd946487769bc2b1dc36833 (diff) | |
download | mariadb-git-61ed0ebe7388d8302f2de7144de41da32bf085ba.tar.gz |
5.1 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 c30498d7778..648783e73b8 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -4259,6 +4259,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) @@ -4280,7 +4284,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) @@ -4305,7 +4309,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; |