From 9c3c3a1f68a3fdb296b535d6686d2e6c1aaff40c Mon Sep 17 00:00:00 2001 From: kelson42 Date: Thu, 19 Apr 2012 08:18:50 +0000 Subject: [PATCH] Manager::readFile() returns now false if the file can not be found/open/read --- src/common/kiwix/manager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/kiwix/manager.cpp b/src/common/kiwix/manager.cpp index e8f460297..34f53d0c3 100644 --- a/src/common/kiwix/manager.cpp +++ b/src/common/kiwix/manager.cpp @@ -95,11 +95,14 @@ namespace kiwix { } bool Manager::readFile(const string path, const bool readOnly) { + bool retVal = true; pugi::xml_document doc; pugi::xml_parse_result result = doc.load_file(path.c_str()); if (result) { this->parseXmlDom(doc, readOnly, path); + } else { + retVal = false; } /* This has to be set (although if the file does not exists) to be @@ -109,7 +112,7 @@ namespace kiwix { this->writableLibraryPath = path; } - return true; + return retVal; } bool Manager::writeFile(const string path) {