From 96493c29bcddabb36766c0ec90fa31dd1672e665 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 28 Apr 2012 15:42:53 -0400 Subject: [PATCH] Handle gcc2 quirks with paths. When asked to build via a relative path (i.e. from within a generated subdir), gcc2 was generating a compilation directory attribute pointing to the generated subdirectory, as well as entering the actual filename attribute as the full absolute path to the file. This wasn't checked for, leading to the issue described in ticket #8498. gcc4 does not appear to have the same behavior, it generates a relative path + filename in all cases. --- src/apps/debugger/files/FileManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/debugger/files/FileManager.cpp b/src/apps/debugger/files/FileManager.cpp index 10f989cce5..aaa78f27a2 100644 --- a/src/apps/debugger/files/FileManager.cpp +++ b/src/apps/debugger/files/FileManager.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2011, Rene Gollent, rene@gollent.com. + * Copyright 2011-2012, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -128,7 +128,7 @@ public: LocatableFile* GetFile(const BString& directoryPath, const BString& relativePath) { - if (directoryPath.Length() == 0) + if (directoryPath.Length() == 0 || relativePath[0] == '/') return GetFile(relativePath); return GetFile(BString(directoryPath) << '/' << relativePath); } @@ -314,7 +314,7 @@ private: directory->ReleaseReference(); return NULL; } - + directory->AddEntry(file); fEntries.Insert(file); @@ -366,7 +366,7 @@ private: if (parentDirectory->GetLocatedPath(locatedDirectoryPath)) _LocateEntryInParentDir(directory, locatedDirectoryPath, true); } - + if (parentDirectory != NULL) parentDirectory->AddEntry(directory);