diff options
author | bar@mysql.com <> | 2005-08-08 19:52:30 +0500 |
---|---|---|
committer | bar@mysql.com <> | 2005-08-08 19:52:30 +0500 |
commit | 281c8ec163a6a9624ea992da31b1488731d1e857 (patch) | |
tree | 9af79335dde7a3443f3f55a42ed6fd07728796af /mysys/mf_pack.c | |
parent | f18796bc511a02a092519de7a507cda3c5ae1f55 (diff) | |
download | mariadb-git-281c8ec163a6a9624ea992da31b1488731d1e857.tar.gz |
Bug#5439 : mysql_server_init() crashes if ShiftJIS path is passed
(important for Adobe).
mf_pack.c, mf_dirname.c, charset.c, my_sys.h:
- adding fs_character_set() function on Windows
- ignoring fake slashes which are just multibyte
parts in several functions in /mysys
Verified by Shu to work on WinXP and Win2k.
Test is not possible, or very hard to do.
Diffstat (limited to 'mysys/mf_pack.c')
-rw-r--r-- | mysys/mf_pack.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index 86172f648f4..049aa59a578 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -124,6 +124,9 @@ uint cleanup_dirname(register my_string to, const char *from) reg4 my_string start; char parent[5], /* for "FN_PARENTDIR" */ buff[FN_REFLEN+1],*end_parentdir; +#ifdef BACKSLASH_MBTAIL + CHARSET_INFO *fs= fs_character_set(); +#endif DBUG_ENTER("cleanup_dirname"); DBUG_PRINT("enter",("from: '%s'",from)); @@ -141,6 +144,15 @@ uint cleanup_dirname(register my_string to, const char *from) length=(uint) (strmov(parent+1,FN_PARENTDIR)-parent); for (pos=start ; (*pos= *from_ptr++) != 0 ; pos++) { +#ifdef BACKSLASH_MBTAIL + uint l; + if (use_mb(fs) && (l= my_ismbchar(fs, from_ptr - 1, from_ptr + 2))) + { + for (l-- ; l ; *++pos= *from_ptr++, l--); + start= pos + 1; /* Don't look inside multi-byte char */ + continue; + } +#endif if (*pos == '/') *pos = FN_LIBCHAR; if (*pos == FN_LIBCHAR) |