diff --git a/src/kits/debugger/files/FileManager.cpp b/src/kits/debugger/files/FileManager.cpp index 33be50f06b..bce3c02db0 100644 --- a/src/kits/debugger/files/FileManager.cpp +++ b/src/kits/debugger/files/FileManager.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2011-2013, Rene Gollent, rene@gollent.com. + * Copyright 2011-2016, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -41,9 +41,12 @@ struct FileManager::EntryPath { EntryPath(const LocatableEntry* entry) : - directory(entry->Parent() != NULL ? entry->Parent()->Path() : NULL), + directory(NULL), name(entry->Name()) { + LocatableDirectory* parent = entry->Parent(); + if (parent != NULL && strlen(parent->Path()) > 0) + directory = parent->Path(); } EntryPath(const EntryPath& other) diff --git a/src/kits/debugger/files/LocatableFile.cpp b/src/kits/debugger/files/LocatableFile.cpp index 38ebdc56e0..ab45947737 100644 --- a/src/kits/debugger/files/LocatableFile.cpp +++ b/src/kits/debugger/files/LocatableFile.cpp @@ -1,5 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2016, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -40,7 +41,9 @@ void LocatableFile::GetPath(BString& _path) const { fParent->GetPath(_path); - _path << '/' << fName; + if (_path.Length() != 0) + _path << '/'; + _path << fName; }