summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-04 00:16:16 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-04 00:16:16 +0000
commit3e56cb4d7dd63528c371a7fb033b291f70daa38f (patch)
tree2a4af6c34db829a9ca8f819c6cbe0bba19226304 /src/char_sql/char.c
parentfd34899afa1d00bcfd740e5802c534d282054fbb (diff)
downloadhercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.tar.gz
hercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.tar.bz2
hercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.tar.xz
hercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.zip
Fixed char-server not making use of name_ignoring_case setting, bugreport:4700
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15374 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 3e3f12c62..78cd67d79 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1325,12 +1325,16 @@ int check_char_name(char * name, char * esc_name)
if( strchr(char_name_letters, name[i]) != NULL )
return -2;
}
-
- // check name (already in use?)
- if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `name` = '%s' LIMIT 1", char_db, esc_name) )
- {
- Sql_ShowDebug(sql_handle);
- return -2;
+ if( name_ignoring_case ) {
+ if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE BINARY `name` = '%s' LIMIT 1", char_db, esc_name) ) {
+ Sql_ShowDebug(sql_handle);
+ return -2;
+ }
+ } else {
+ if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `name` = '%s' LIMIT 1", char_db, esc_name) ) {
+ Sql_ShowDebug(sql_handle);
+ return -2;
+ }
}
if( Sql_NumRows(sql_handle) > 0 )
return -1; // name already exists