summaryrefslogtreecommitdiff
path: root/src/shared/directoryentry.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-08-17 08:54:53 +0200
committerTannin <devnull@localhost>2013-08-17 08:54:53 +0200
commit87f4e2df260e502bce61783a66e062af1b46e789 (patch)
tree1110a6af42356fcbfbe6d8dbea0aceab9550f3e7 /src/shared/directoryentry.cpp
parent92720131035a86bf06a29d35ebccd980c0178e6b (diff)
parent78c4178f2a70bb55bd761efc92d58b8ac0e3747b (diff)
Merge
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 76912b66..802c3696 100644
--- a/src/shared/directoryentry.cpp
+++ b/src/shared/directoryentry.cpp
@@ -704,11 +704,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"\\/");
@@ -732,9 +733,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) {
@@ -752,7 +754,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();
}
}
@@ -833,7 +835,7 @@ FileEntry::Ptr FileRegister::getFile(FileEntry::Index index)
if (iter != m_Files.end()) {
return iter->second;
}
- return NULL;
+ return FileEntry::Ptr();
}