Debugger: fixed Bookmarks naming

This commit is contained in:
ansstuff 2012-09-27 17:07:43 +00:00
parent 84bb3a8d1d
commit 973c6cb9bb
1 changed files with 12 additions and 6 deletions

View File

@ -741,17 +741,23 @@ void NameDebuggerBookmark(HWND hwnd)
MessageBox(hwnd, "Please select a bookmark from the list", "Error", MB_OK | MB_ICONERROR); MessageBox(hwnd, "Please select a bookmark from the list", "Error", MB_OK | MB_ICONERROR);
return; return;
} else } else
{
if (bookmarks_name[selectedItem].size())
{ {
strcpy(bookmarkDescription, bookmarks_name[selectedItem].c_str()); strcpy(bookmarkDescription, bookmarks_name[selectedItem].c_str());
} else
{
bookmarkDescription[0] = 0;
// try to find the same address in bookmarks // try to find the same address in bookmarks
for (int i = bookmarks_addr.size() - 1; i>= 0; i--) for (int i = bookmarks_addr.size() - 1; i>= 0; i--)
{ {
if (i != selectedItem && bookmarks_addr[i] == bookmarks_addr[selectedItem]) if (i != selectedItem && bookmarks_addr[i] == bookmarks_addr[selectedItem] && bookmarks_name[i].size())
{ {
strcpy(bookmarkDescription, bookmarks_name[i].c_str()); strcpy(bookmarkDescription, bookmarks_name[i].c_str());
break; break;
} }
} }
}
// Show the bookmark name dialog // Show the bookmark name dialog
if (DialogBox(fceu_hInstance, "NAMEBOOKMARKDLG", hwnd, nameBookmarkCallB)) if (DialogBox(fceu_hInstance, "NAMEBOOKMARKDLG", hwnd, nameBookmarkCallB))
{ {