Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a856f155
Commit
a856f155
authored
Aug 09, 2005
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/home/bar/mysql-4.1.b5439
parents
25388380
281c8ec1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
1 deletion
+75
-1
include/my_sys.h
include/my_sys.h
+5
-0
mysys/charset.c
mysys/charset.c
+26
-0
mysys/mf_dirname.c
mysys/mf_dirname.c
+32
-1
mysys/mf_pack.c
mysys/mf_pack.c
+12
-0
No files found.
include/my_sys.h
View file @
a856f155
...
...
@@ -788,6 +788,11 @@ extern my_bool init_compiled_charsets(myf flags);
extern
void
add_compiled_collation
(
CHARSET_INFO
*
cs
);
extern
ulong
escape_string_for_mysql
(
CHARSET_INFO
*
charset_info
,
char
*
to
,
const
char
*
from
,
ulong
length
);
#ifdef __WIN__
#define BACKSLASH_MBTAIL
/* File system character set */
extern
CHARSET_INFO
*
fs_character_set
(
void
);
#endif
#ifdef __WIN__
extern
my_bool
have_tcpip
;
/* Is set if tcpip is used */
...
...
mysys/charset.c
View file @
a856f155
...
...
@@ -637,3 +637,29 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to,
*
to
=
0
;
return
(
ulong
)
(
to
-
to_start
);
}
#ifdef BACKSLASH_MBTAIL
static
CHARSET_INFO
*
fs_cset_cache
=
NULL
;
CHARSET_INFO
*
fs_character_set
()
{
if
(
!
fs_cset_cache
)
{
char
buf
[
10
]
=
"cp"
;
GetLocaleInfo
(
LOCALE_SYSTEM_DEFAULT
,
LOCALE_IDEFAULTANSICODEPAGE
,
buf
+
2
,
sizeof
(
buf
)
-
3
);
/*
We cannot call get_charset_by_name here
because fs_character_set() is executed before
LOCK_THD_charset mutex initialization, which
is used inside get_charset_by_name.
As we're now interested in cp932 only,
let's just detect it using strcmp().
*/
fs_cset_cache
=
!
strcmp
(
buf
,
"cp932"
)
?
&
my_charset_cp932_japanese_ci
:
&
my_charset_bin
;
}
return
fs_cset_cache
;
}
#endif
mysys/mf_dirname.c
View file @
a856f155
...
...
@@ -22,6 +22,9 @@
uint
dirname_length
(
const
char
*
name
)
{
register
my_string
pos
,
gpos
;
#ifdef BASKSLASH_MBTAIL
CHARSET_INFO
*
fs
=
fs_character_set
();
#endif
#ifdef FN_DEVCHAR
if
((
pos
=
(
char
*
)
strrchr
(
name
,
FN_DEVCHAR
))
==
0
)
#endif
...
...
@@ -29,12 +32,22 @@ uint dirname_length(const char *name)
gpos
=
pos
++
;
for
(
;
*
pos
;
pos
++
)
/* Find last FN_LIBCHAR */
{
#ifdef BASKSLASH_MBTAIL
uint
l
;
if
(
use_mb
(
fs
)
&&
(
l
=
my_ismbchar
(
fs
,
pos
,
pos
+
3
)))
{
pos
+=
l
-
1
;
continue
;
}
#endif
if
(
*
pos
==
FN_LIBCHAR
||
*
pos
==
'/'
#ifdef FN_C_AFTER_DIR
||
*
pos
==
FN_C_AFTER_DIR
||
*
pos
==
FN_C_AFTER_DIR_2
#endif
)
gpos
=
pos
;
}
return
((
uint
)
(
uint
)
(
gpos
+
1
-
(
char
*
)
name
));
}
...
...
@@ -85,6 +98,9 @@ uint dirname_part(my_string to, const char *name)
char
*
convert_dirname
(
char
*
to
,
const
char
*
from
,
const
char
*
from_end
)
{
char
*
to_org
=
to
;
#ifdef BACKSLASH_MBTAIL
CHARSET_INFO
*
fs
=
fs_character_set
();
#endif
/* We use -2 here, becasue we need place for the last FN_LIBCHAR */
if
(
!
from_end
||
(
from_end
-
from
)
>
FN_REFLEN
-
2
)
...
...
@@ -103,7 +119,22 @@ char *convert_dirname(char *to, const char *from, const char *from_end)
*
to
++=
FN_C_AFTER_DIR
;
#endif
else
*
to
++=
*
from
;
{
#ifdef BACKSLASH_MBTAIL
uint
l
;
if
(
use_mb
(
fs
)
&&
(
l
=
my_ismbchar
(
fs
,
from
,
from
+
3
)))
{
memmove
(
to
,
from
,
l
);
to
+=
l
;
from
+=
l
-
1
;
to_org
=
to
;
/* Don't look inside mbchar */
}
else
#endif
{
*
to
++=
*
from
;
}
}
}
*
to
=
0
;
}
...
...
mysys/mf_pack.c
View file @
a856f155
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment