X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigparser.cpp;h=94a12e6e9044e204e581e75c141c71c528a66801;hb=fe23e07f024c2cbcb05007f3ed70c9acf632a2f0;hp=6fdc56c32dd45b7a5b9348651473865e5fc5327b;hpb=82c89d40cc6cd0100b4c68e72f869ff007f4ef36;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configparser.cpp b/src/configparser.cpp index 6fdc56c32..94a12e6e9 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -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::const_iterator iter = files.begin(); iter != files.end(); ++iter) { const std::string path = includedir + '/' + *iter;