]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Move strlower into nspace namespace where hash<std::string> lives
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 10 Aug 2006 18:54:29 +0000 (18:54 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 10 Aug 2006 18:54:29 +0000 (18:54 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4850 e03df62e-2008-0410-955e-edbf42e46eb7

include/hashcomp.h
include/helperfuncs.h
src/hashcomp.cpp
src/helperfuncs.cpp
src/modules/m_helpop.cpp

index 6c90ee919ed4ac5f26e2df9a34e603227932cb13..0ca8a6facb41812297494d258273f557b4366bae 100644 (file)
@@ -43,6 +43,8 @@ using irc::sockets::insp_inaddr;
 
 namespace nspace
 {
+       void strlower(char *n);
+
         template<> struct hash<insp_inaddr>
         {
                 size_t operator()(const insp_inaddr &a) const;
index 21cb6caf39b24525e59a810f469a1b97a8f5c256..7a55e5d2365d14323fe30fa18aa1c93ef885f640 100644 (file)
@@ -48,7 +48,6 @@ enum DebugLevel
 #define STRINGIFY(x) STRINGIFY2(x) 
 #define log(l, x, args...) InspIRCd::Log(l, __FILE__ ":" STRINGIFY(__LINE__) ": " x, ##args)
 
-void strlower(char *n);
 void Error(int status);
 void ShowMOTD(userrec *user);
 void ShowRULES(userrec *user);
index 278ea0044e41cca8cbdd05be2d905f53cf47c93e..6606884c992ddaa0803835fb7f5c91cb2843ccc0 100644 (file)
@@ -60,6 +60,24 @@ extern const char lowermap[255];
 using namespace std;
 using namespace irc::sockets;
 
+/* convert a string to lowercase. Note following special circumstances
+ * taken from RFC 1459. Many "official" server branches still hold to this
+ * rule so i will too;
+ *
+ *  Because of IRC's scandanavian origin, the characters {}| are
+ *  considered to be the lower case equivalents of the characters []\,
+ *  respectively. This is a critical issue when determining the
+ *  equivalence of two nicknames.
+ */
+void nspace::strlower(char *n)
+{
+        if (n)
+        {
+                for (char* t = n; *t; t++)
+                        *t = lowermap[(unsigned char)*t];
+        }
+}
+
 size_t nspace::hash<insp_inaddr>::operator()(const insp_inaddr &a) const
 {
        size_t q;
index d048b75df9da59982f853f9198069f8cc32834b5..71a8d24a0029b7a1bd1315ef4e2cabaf66c1c480 100644 (file)
@@ -248,24 +248,6 @@ void InspIRCd::WriteMode(const char* modes, int flags, const char* text, ...)
        }
 }
 
-/* convert a string to lowercase. Note following special circumstances
- * taken from RFC 1459. Many "official" server branches still hold to this
- * rule so i will too;
- *
- *  Because of IRC's scandanavian origin, the characters {}| are
- *  considered to be the lower case equivalents of the characters []\,
- *  respectively. This is a critical issue when determining the
- *  equivalence of two nicknames.
- */
-void strlower(char *n)
-{
-       if (n)
-       {
-               for (char* t = n; *t; t++)
-                       *t = lowermap[(unsigned char)*t];
-       }
-}
-
 /* Find a user record by nickname and return a pointer to it */
 
 userrec* InspIRCd::FindNick(const std::string &nick)
index 28e82627682324c4ab236b8278761114d1cdcbd4..00ba05c243aa1be5d1c497a3d9b2b7840eadf918 100644 (file)
@@ -149,7 +149,8 @@ bool do_helpop(const char** parameters, int pcnt, userrec *src)
                strlcpy(search,parameters[0],MAXBUF);
        }
 
-       strlower(search);
+       for (char* n = search; *n; n++)
+               *n = tolower(*n);
 
        for (int i = 1; output != ""; i++)
        {