Commit c5aacafe authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

winecfg: No need to cut a backslash if it does not exist.

parent 19254eb4
......@@ -377,19 +377,17 @@ static void on_remove_app_click(HWND dialog)
{
HWND listview = GetDlgItem(dialog, IDC_APP_LISTVIEW);
int selection = get_listview_selection(listview);
char *section = keypath(""); /* AppDefaults\\whatever.exe\\ */
LVITEMW item;
item.iItem = selection;
item.iSubItem = 0;
item.mask = LVIF_PARAM;
WINE_TRACE("selection=%d, section=%s\n", selection, section);
WINE_TRACE("selection=%d\n", selection);
assert( selection != 0 ); /* user cannot click this button when "default settings" is selected */
section[strlen(section)] = '\0'; /* remove last backslash */
set_reg_key(config_key, section, NULL, NULL); /* delete the section */
set_reg_key(config_key, keypath(""), NULL, NULL); /* delete the section */
SendMessageW(listview, LVM_GETITEMW, 0, (LPARAM) &item);
HeapFree (GetProcessHeap(), 0, (void*)item.lParam);
SendMessageW(listview, LVM_DELETEITEM, selection, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment