diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-17 19:50:25 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-17 19:50:25 +0200 |
commit | bdea8706d8050ba3ea00b580bba795bc468cfdbd (patch) | |
tree | 27ec86d16edadcb0811d609c22b3d6e9168491e8 /lib/inifile | |
parent | Added Prefab initializers to SELFTEST code. (diff) | |
download | cuberite-bdea8706d8050ba3ea00b580bba795bc468cfdbd.tar cuberite-bdea8706d8050ba3ea00b580bba795bc468cfdbd.tar.gz cuberite-bdea8706d8050ba3ea00b580bba795bc468cfdbd.tar.bz2 cuberite-bdea8706d8050ba3ea00b580bba795bc468cfdbd.tar.lz cuberite-bdea8706d8050ba3ea00b580bba795bc468cfdbd.tar.xz cuberite-bdea8706d8050ba3ea00b580bba795bc468cfdbd.tar.zst cuberite-bdea8706d8050ba3ea00b580bba795bc468cfdbd.zip |
Diffstat (limited to 'lib/inifile')
-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; } |