From bdea8706d8050ba3ea00b580bba795bc468cfdbd Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 17 Apr 2014 18:50:25 +0100 Subject: Added new AI rules + Added new AI rules handling cacti and large heights * Fixed cIniFile not recognising comments in cIniFile::ReadFile() * Fixed users.ini not being properly generated * Changed all instances of (int)floor(GetPosXXX()) to POSXXX_TOINT --- lib/inifile/iniFile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/inifile') 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; } -- cgit v1.2.3 From 0e0c9d82483e01840faf7027fc01a998d5cf2f18 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 25 Apr 2014 12:24:09 -0700 Subject: Missed these CMakeLists. --- lib/inifile/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/inifile') diff --git a/lib/inifile/CMakeLists.txt b/lib/inifile/CMakeLists.txt index efbd09796..321d501d7 100644 --- a/lib/inifile/CMakeLists.txt +++ b/lib/inifile/CMakeLists.txt @@ -1,7 +1,11 @@ - cmake_minimum_required (VERSION 2.6) project (iniFile) include_directories ("${PROJECT_SOURCE_DIR}/../../src/") -add_library(iniFile iniFile) +file(GLOB SOURCE + "*.h" + "*.cpp" +) + +add_library(iniFile ${SOURCE}) -- cgit v1.2.3