summaryrefslogtreecommitdiffstats
path: root/lib/inifile/iniFile.cpp
diff options
context:
space:
mode:
authorjfhumann <j.f.humann@gmail.com>2014-04-18 21:44:58 +0200
committerjfhumann <j.f.humann@gmail.com>2014-04-18 21:44:58 +0200
commit67344a378210b1f9c21a50f02e1ff2459be66d5f (patch)
treed775281489827d49139ee3e23fba87a1d079cf89 /lib/inifile/iniFile.cpp
parentDid some static analysis, fixed some bugs and optimized a lot of code (diff)
parentAdded performance test of the nether fort generator. (diff)
downloadcuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.gz
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.bz2
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.lz
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.xz
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.zst
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.zip
Diffstat (limited to 'lib/inifile/iniFile.cpp')
-rw-r--r--lib/inifile/iniFile.cpp5
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;
}