]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configparser.cpp
Squish the cmd_whowas header.
[user/henk/code/inspircd.git] / src / configparser.cpp
index 6fdc56c32dd45b7a5b9348651473865e5fc5327b..94a12e6e9044e204e581e75c141c71c528a66801 100644 (file)
@@ -158,12 +158,20 @@ struct Parser
                }
        }
 
+       bool wordchar(char ch)
+       {
+               return isalnum(ch)
+                       || ch == '-'
+                       || ch == '.'
+                       || ch == '_';
+       }
+
        void nextword(std::string& rv)
        {
                int ch = next();
                while (isspace(ch))
                        ch = next();
-               while (isalnum(ch) || ch == '_'|| ch == '-')
+               while (wordchar(ch))
                {
                        rv.push_back(ch);
                        ch = next();
@@ -205,7 +213,7 @@ struct Parser
                                while (1)
                                {
                                        ch = next();
-                                       if (isalnum(ch) || (varname.empty() && ch == '#') || ch == '.')
+                                       if (wordchar(ch) || (varname.empty() && ch == '#'))
                                                varname.push_back(ch);
                                        else if (ch == ';')
                                                break;
@@ -423,7 +431,7 @@ void ParseStack::DoInclude(ConfigTag* tag, int flags)
                if (!FileSystem::GetFileList(includedir, files, "*.conf"))
                        throw CoreException("Unable to read directory for include: " + includedir);
 
-               std::sort(files.begin(), files.end()); 
+               std::sort(files.begin(), files.end());
                for (std::vector<std::string>::const_iterator iter = files.begin(); iter != files.end(); ++iter)
                {
                        const std::string path = includedir + '/' + *iter;