diff options
author | daniel0916 <theschokolps@gmail.com> | 2014-04-18 15:04:32 +0200 |
---|---|---|
committer | daniel0916 <theschokolps@gmail.com> | 2014-04-18 15:04:32 +0200 |
commit | b239de66db5350319ac626700030bfd688851916 (patch) | |
tree | 2dd1b87460eb14678cda808c94002d5cebbc2e4a /lib/inifile/iniFile.cpp | |
parent | Fixed Errors (diff) | |
parent | Added performance test of the nether fort generator. (diff) | |
download | cuberite-b239de66db5350319ac626700030bfd688851916.tar cuberite-b239de66db5350319ac626700030bfd688851916.tar.gz cuberite-b239de66db5350319ac626700030bfd688851916.tar.bz2 cuberite-b239de66db5350319ac626700030bfd688851916.tar.lz cuberite-b239de66db5350319ac626700030bfd688851916.tar.xz cuberite-b239de66db5350319ac626700030bfd688851916.tar.zst cuberite-b239de66db5350319ac626700030bfd688851916.zip |
Diffstat (limited to '')
-rw-r--r-- | lib/inifile/iniFile.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/inifile/iniFile.cpp b/lib/inifile/iniFile.cpp index cf8b63987..19db9723a 100644 --- a/lib/inifile/iniFile.cpp +++ b/lib/inifile/iniFile.cpp @@ -154,7 +154,7 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect) case ';': case '#': { - if (names.size() == 0) + if (names.empty()) { AddHeaderComment(line.substr(pLeft + 1)); } @@ -168,8 +168,9 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect) } // while (getline()) f.close(); - if (names.size() == 0) + if (keys.empty() && names.empty() && comments.empty()) { + // File be empty or unreadable, equivalent to nonexistant return false; } |