From: Fredrik Tolf Date: Sun, 14 Oct 2007 00:44:12 +0000 (+0200) Subject: A couple of bugfixes in dolconf. X-Git-Tag: 1.0~14 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=42aa110f8f5706c799ff96df0ed4b41327c70b26;p=doldaconnect.git A couple of bugfixes in dolconf. --- diff --git a/config/util/dolconf-wnd.desc b/config/util/dolconf-wnd.desc index 386d055..8285dc1 100644 --- a/config/util/dolconf-wnd.desc +++ b/config/util/dolconf-wnd.desc @@ -61,9 +61,9 @@ end end :hbtnbox layout: END - $sbtn name: ok stock: OK sig: activate - $sbtn name: cancel stock: CANCEL sig: activate accel: Escape - $sbtn name: apply stock: APPLY sig: activate + $sbtn name: ok stock: OK sig: clicked + $sbtn name: cancel stock: CANCEL sig: clicked accel: Escape + $sbtn name: apply stock: APPLY sig: clicked end end end diff --git a/config/util/dolconf.c b/config/util/dolconf.c index 52cffe1..7a8b2fa 100644 --- a/config/util/dolconf.c +++ b/config/util/dolconf.c @@ -233,7 +233,7 @@ char *getword(char **p) p2 = *p + strlen(*p); len = p2 - *p - ((*p2 == '\"')?1:0); buf = smalloc(len + 1); - memcpy(buf, *p, len); + memcpy(buf, *p + ((delim == '\"')?1:0), len); buf[len] = 0; *p = p2 + ((*p2 == '\"')?1:0); for(p2 = buf; *p2; p2++, len--) { @@ -739,11 +739,11 @@ int saveconfig(void) { struct cfvar *cv; + cfw2conf(); if((cv = cfwvalid()) != NULL) { msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, cv->vld->invmsg, cv->rname); return(-1); } - cfw2conf(); return(writeconfig()); } @@ -777,7 +777,7 @@ void cb_cfw_quit_activate(GtkWidget *widget, gpointer uudata) } */ -void cb_cfw_ok_activate(GtkWidget *widget, gpointer uudata) +void cb_cfw_ok_clicked(GtkWidget *widget, gpointer uudata) { if(saveconfig()) return; @@ -786,13 +786,13 @@ void cb_cfw_ok_activate(GtkWidget *widget, gpointer uudata) state = -1; } -void cb_cfw_cancel_activate(GtkWidget *widget, gpointer uudata) +void cb_cfw_cancel_clicked(GtkWidget *widget, gpointer uudata) { gtk_main_quit(); state = -1; } -void cb_cfw_apply_activate(GtkWidget *widget, gpointer uudata) +void cb_cfw_apply_clicked(GtkWidget *widget, gpointer uudata) { if(saveconfig()) return;