diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 3ae087079a..e34176e1f5 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -762,8 +762,7 @@ void CDlgAdvPreferences::OnExclusiveAppListEvent(wxCommandEvent& ev) { // handles Add button clicked void CDlgAdvPreferences::OnAddExclusiveApp(wxCommandEvent&) { wxString strMachineName; - unsigned int i; - int j, n; + int i, j, n; bool hostIsMac = false; bool hostIsWin = false; bool isDuplicate; @@ -803,7 +802,7 @@ void CDlgAdvPreferences::OnAddExclusiveApp(wxCommandEvent&) { if (picker.ShowModal() != wxID_OK) return; picker.GetFilenames(appNames); - for (i=0; i=0; --i) { #ifdef __WXMSW__ // Under Windows, filename may include paths if a shortcut selected wxString appNameOnly = appNames[i].AfterLast('\\'); @@ -815,6 +814,7 @@ void CDlgAdvPreferences::OnAddExclusiveApp(wxCommandEvent&) { errmsg.Printf(_("'%s' is not an executable application."), appNames[i].c_str()); wxGetApp().SafeMessageBox(errmsg, _("Add Exclusive App"), wxOK | wxICON_EXCLAMATION, this); + appNames.RemoveAt(i); continue; } } @@ -838,7 +838,7 @@ void CDlgAdvPreferences::OnAddExclusiveApp(wxCommandEvent&) { } - for (i=0; i