summaryrefslogtreecommitdiff
path: root/src/shared/directoryentry.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-08-15 22:13:18 +0200
committerTannin <devnull@localhost>2013-08-15 22:13:18 +0200
commit7d79e3ad1e8a710e836e1cd44106a610e6d2a049 (patch)
tree5193b33f6a943fd599832aaba46a653f7d471021 /src/shared/directoryentry.cpp
parentd0f2c4fcf79222d5c6f3c17188a811b0a47833c6 (diff)
- 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"
Diffstat (limited to 'src/shared/directoryentry.cpp')
-rw-r--r--src/shared/directoryentry.cpp16
1 files changed, 9 insertions, 7 deletions
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<DirectoryEntry*>::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();
}