diff options
| author | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-07-25 21:58:20 -0400 |
|---|---|---|
| committer | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-07-25 21:58:20 -0400 |
| commit | ae38212c1ce829c783edf971081c90137abb49a0 (patch) | |
| tree | 5c652d9cdc38103dec6fa112d57fca882b4e3e44 /src/wildcard.cpp | |
| parent | 15d7f0f6fe8bb903275f603f734c13f65f3aa906 (diff) | |
Epic commit to replace most of the strings in Anope with a single Anope::string class, plus some other little fixes here and there. If you follow 1.9.x development and are testing things, THIS is one of those things that NEEDS testing.
Diffstat (limited to 'src/wildcard.cpp')
| -rw-r--r-- | src/wildcard.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 42f0812f7..1716068d1 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -2,9 +2,9 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, bool case_sensitive) { - unsigned char *cp = NULL, *mp = NULL; - unsigned char *string = const_cast<unsigned char *>(str); // XXX: unsafe cast - unsigned char *wild = const_cast<unsigned char *>(mask); // XXX: unsafe cast + const unsigned char *cp = NULL, *mp = NULL; + const unsigned char *string = str; + const unsigned char *wild = mask; while (*string && *wild != '*') { @@ -19,8 +19,8 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, return false; } - wild++; - string++; + ++wild; + ++string; } while (*string) @@ -71,7 +71,7 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, return !*wild; } -bool Anope::Match(const std::string &str, const std::string &mask, bool case_sensitive) +bool Anope::Match(const Anope::string &str, const Anope::string &mask, bool case_sensitive) { return match_internal(reinterpret_cast<const unsigned char *>(str.c_str()), reinterpret_cast<const unsigned char *>(mask.c_str()), case_sensitive); } |
