Fix regression introduced in 21d8063.
We can't use BPath to get the filename for the source file path embedded in the debug information, since it may be relative, which BPath will try to normalize.
This commit is contained in:
@@ -1459,18 +1459,20 @@ TeamWindow::_HandleResolveMissingSourceFile(entry_ref& locatedPath)
|
|||||||
if (sourceFile != NULL) {
|
if (sourceFile != NULL) {
|
||||||
BString sourcePath;
|
BString sourcePath;
|
||||||
sourceFile->GetPath(sourcePath);
|
sourceFile->GetPath(sourcePath);
|
||||||
BPath sourceFilePath(sourcePath);
|
BString sourceFileName(sourcePath);
|
||||||
BPath targetFilePath(&locatedPath);
|
int32 index = sourcePath.FindLast('/');
|
||||||
if (sourceFilePath.InitCheck() != B_OK
|
if (index >= 0)
|
||||||
|| targetFilePath.InitCheck() != B_OK) {
|
sourceFileName.Remove(0, index + 1);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcmp(sourceFilePath.Leaf(), targetFilePath.Leaf()) != 0) {
|
BPath targetFilePath(&locatedPath);
|
||||||
|
if (targetFilePath.InitCheck() != B_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (strcmp(sourceFileName.String(), targetFilePath.Leaf()) != 0) {
|
||||||
BString message;
|
BString message;
|
||||||
message.SetToFormat("The names of source file '%s' and located"
|
message.SetToFormat("The names of source file '%s' and located"
|
||||||
" file '%s' differ. Use file anyway?",
|
" file '%s' differ. Use file anyway?",
|
||||||
sourceFilePath.Leaf(), targetFilePath.Leaf());
|
sourceFileName.String(), targetFilePath.Leaf());
|
||||||
BAlert* alert = new(std::nothrow) BAlert(
|
BAlert* alert = new(std::nothrow) BAlert(
|
||||||
"Source path mismatch", message.String(), "Cancel", "Use");
|
"Source path mismatch", message.String(), "Cancel", "Use");
|
||||||
if (alert == NULL)
|
if (alert == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user