Search
lxdream.org :: lxdream :: r475:49841795db97
lxdream 0.9.1
released Jun 29
Download Now
changeset475:49841795db97
parent474:a0345bf296ed
child476:75eb00fc191d
authornkeynes
dateWed Oct 31 09:06:48 2007 +0000 (12 years ago)
Handle case of setting value to itself (ie don't change anything)
src/config.c
1.1 --- a/src/config.c Wed Oct 31 09:05:44 2007 +0000
1.2 +++ b/src/config.c Wed Oct 31 09:06:48 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: config.c,v 1.5 2007-10-28 08:29:29 nkeynes Exp $
1.6 + * $Id: config.c,v 1.6 2007-10-31 09:06:48 nkeynes Exp $
1.7 *
1.8 * User configuration support
1.9 *
1.10 @@ -112,10 +112,12 @@
1.11
1.12 void lxdream_set_config_value( lxdream_config_entry_t param, const gchar *value )
1.13 {
1.14 - if( param->value != param->default_value && param->value != NULL ) {
1.15 - free( param->value );
1.16 + if( param->value != value ) {
1.17 + if( param->value != param->default_value && param->value != NULL ) {
1.18 + free( param->value );
1.19 + }
1.20 + param->value = g_strdup(value);
1.21 }
1.22 - param->value = g_strdup(value);
1.23 }
1.24
1.25 void lxdream_set_global_config_value( int key, const gchar *value )
.