Support for PuTTY-style command-line arguments in Unix PuTTY. I
[u/mdw/putty] / unix / gtkdlg.c
index f5fe5d4..6f906df 100644 (file)
@@ -993,6 +993,7 @@ static void list_selchange(GtkList *list, gpointer data)
 {
     struct dlgparam *dp = (struct dlgparam *)data;
     struct uctrl *uc = dlg_find_bywidget(dp, GTK_WIDGET(list));
+    if (!uc) return;
     uc->ctrl->generic.handler(uc->ctrl, dp, dp->data, EVENT_SELCHANGE);
 }
 
@@ -1910,8 +1911,6 @@ int do_config_box(const char *title, Config *cfg)
     struct selparam *selparams = NULL;
     int nselparams = 0, selparamsize = 0;
 
-    do_defaults(NULL, cfg);
-
     dlg_init(&dp);
 
     {
@@ -1922,7 +1921,7 @@ int do_config_box(const char *title, Config *cfg)
         gtk_widget_unref(listitem);
     }
 
-    sl.nsessions = 0;
+    get_sesslist(&sl, TRUE);
 
     for (index = 0; index < lenof(scs.sc); index++) {
        scs.sc[index].action = SHORTCUT_EMPTY;
@@ -2115,6 +2114,7 @@ int do_config_box(const char *title, Config *cfg)
 
     gtk_main();
 
+    get_sesslist(&sl, FALSE);
     dlg_cleanup(&dp);
     sfree(selparams);