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.
This commit is contained in:
Rene Gollent
2012-04-28 15:42:53 -04:00
parent 1f5facdbe7
commit 96493c29bc
+4 -4
View File
@@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Copyright 2011, Rene Gollent, [email protected].
* Copyright 2011-2012, Rene Gollent, [email protected].
* 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);