diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp index 7b456474d6..948351aa38 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -1459,18 +1459,20 @@ TeamWindow::_HandleResolveMissingSourceFile(entry_ref& locatedPath) if (sourceFile != NULL) { BString sourcePath; sourceFile->GetPath(sourcePath); - BPath sourceFilePath(sourcePath); - BPath targetFilePath(&locatedPath); - if (sourceFilePath.InitCheck() != B_OK - || targetFilePath.InitCheck() != B_OK) { - return; - } + BString sourceFileName(sourcePath); + int32 index = sourcePath.FindLast('/'); + if (index >= 0) + sourceFileName.Remove(0, index + 1); - 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; message.SetToFormat("The names of source file '%s' and located" " file '%s' differ. Use file anyway?", - sourceFilePath.Leaf(), targetFilePath.Leaf()); + sourceFileName.String(), targetFilePath.Leaf()); BAlert* alert = new(std::nothrow) BAlert( "Source path mismatch", message.String(), "Cancel", "Use"); if (alert == NULL)