diff options
author | Adam <Adam@anope.org> | 2010-11-30 17:25:42 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:37:03 -0500 |
commit | a507816701d136a1c22d2f6779d811840d61577c (patch) | |
tree | 37e397d8e6d6f04685287b7ec3aa7d0662460da4 /src | |
parent | c41c82857464c34c61e6f2cf1939cea866f7d49a (diff) |
Fixed looking up users to use case insensitivity
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 2 | ||||
-rw-r--r-- | src/hashcomp.cpp | 15 | ||||
-rw-r--r-- | src/users.cpp | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 09742acff..098404ceb 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -9,7 +9,7 @@ #include "modules.h" #include "commands.h" -patricia_tree<BotInfo *, std::equal_to<ci::string> > BotListByNick; +patricia_tree<BotInfo *, ci::ci_char_traits> BotListByNick; patricia_tree<BotInfo *> BotListByUID; BotInfo *BotServ = NULL; diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 5f65738ea..d50fca3c0 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -87,6 +87,11 @@ const char *irc::irc_char_traits::find(const char *s1, int n, char c) return n >= 0 ? s1 : NULL; } +const char irc::irc_char_traits::chartolower(char c1) +{ + return rfc_case_insensitive_map[static_cast<unsigned char>(c1)]; +} + /* VS 2008 specific function */ bool irc::hash::operator()(const Anope::string &s1, const Anope::string &s2) const { @@ -153,6 +158,11 @@ const char *ci::ci_char_traits::find(const char *s1, int n, char c) return n >= 0 ? s1 : NULL; } +const char ci::ci_char_traits::chartolower(char c1) +{ + return ascii_case_insensitive_map[static_cast<unsigned char>(c1)]; +} + /* VS 2008 specific function */ bool ci::hash::operator()(const Anope::string &s1, const Anope::string &s2) const { @@ -178,6 +188,11 @@ size_t ci::hash::operator()(const Anope::string &s) const return operator()(s.ci_str()); } +const char std::std_char_traits::chartolower(char c1) +{ + return c1; +} + /** Compare two Anope::strings as ci::strings * @param s1 The first string * @param s2 The second string diff --git a/src/users.cpp b/src/users.cpp index 58d931789..f6c0983ef 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -12,7 +12,7 @@ #include "services.h" #include "modules.h" -patricia_tree<User *, std::equal_to<ci::string> > UserListByNick; +patricia_tree<User *, ci::ci_char_traits> UserListByNick; patricia_tree<User *> UserListByUID; int32 opcnt = 0; |