* allocate space to store the current contents of the saved
* session edit box (since it must persist even when we switch
* panels, but is not part of the Config).
+ *
+ * Of course, this doesn't need to be done mid-session.
*/
- if (!dlg_get_privdata(ssd->editbox, dlg)) {
+ if (!ssd->editbox) {
+ savedsession = NULL;
+ } else if (!dlg_get_privdata(ssd->editbox, dlg)) {
savedsession = (char *)
dlg_alloc_privdata(ssd->editbox, dlg, SAVEDSESSION_LEN);
savedsession[0] = '\0';
dlg_refresh(ssd->listbox, dlg);
}
} else if (ctrl == ssd->okbutton) {
+ if (!savedsession) {
+ /* In a mid-session Change Settings, Apply is always OK. */
+ dlg_end(dlg, 1);
+ return;
+ }
/*
* Annoying special case. If the `Open' button is
* pressed while no host name is currently set, _and_
ssd = (struct sessionsaver_data *)
ctrl_alloc(b, sizeof(struct sessionsaver_data));
+ memset(ssd, 0, sizeof(*ssd));
ssd->sesslist = (midsession ? NULL : sesslist);
/*