From 7d79e3ad1e8a710e836e1cd44106a610e6d2a049 Mon Sep 17 00:00:00 2001 From: Tannin Date: Thu, 15 Aug 2013 22:13:18 +0200 Subject: - bugfix: nameprefix-flag incorrectly interpreted on oblivion-style bsas - bugfix: optimization for missing inis fixed - bugfix: fixmods didn't search for esps in overwrite - bugfix: configurator didn't work for fallout new vegas because of a missing cast - bugfix: configurator attempted parameter formatting on ini files instead of using the raw data - bugfix: searching for a path in the directory structure could cause a crash when not using the directory output - optimization to findfirstfile for cases where a single file is searched - display of bsas changed. hopefully it is more understandable now - cache for the test whether a mod is in conflict. Should speed ab scrolling in mod list - mod list has now an additional column for the installation time - nmm importer no longer cancels in cases where a data file references an undeclared mod. - integrated improved settings.json for the configurator contributed by "delta534" --- src/shared/directoryentry.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/shared/directoryentry.cpp') diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index ceba113d..7897b6aa 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -699,11 +699,12 @@ const FileEntry::Ptr DirectoryEntry::searchFile(const std::wstring &path, const *directory = NULL; } - if ((path.length() == 0) || - (path == L"*")) { + if ((path.length() == 0) || (path == L"*")) { // no file name -> the path ended on a (back-)slash - *directory = this; - return NULL; + if (directory != NULL) { + *directory = this; + } + return FileEntry::Ptr(); } size_t len = path.find_first_of(L"\\/"); @@ -727,9 +728,10 @@ const FileEntry::Ptr DirectoryEntry::searchFile(const std::wstring &path, const return temp->searchFile(path.substr(len + 1), directory); } } - return NULL; + return FileEntry::Ptr(); } + DirectoryEntry *DirectoryEntry::findSubDirectory(const std::wstring &name) const { for (std::vector::const_iterator iter = m_SubDirectories.begin(); iter != m_SubDirectories.end(); ++iter) { @@ -747,7 +749,7 @@ const FileEntry::Ptr DirectoryEntry::findFile(const std::wstring &name) if (iter != m_Files.end()) { return m_FileRegister->getFile(iter->second); } else { - return NULL; + return FileEntry::Ptr(); } } @@ -828,7 +830,7 @@ FileEntry::Ptr FileRegister::getFile(FileEntry::Index index) if (iter != m_Files.end()) { return iter->second; } - return NULL; + return FileEntry::Ptr(); } -- cgit v1.3.1