Search
lxdream.org :: lxdream/src/config.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/config.c
changeset 866:86cd01c2b2d3
prev759:f16975739abc
next1015:ad448bedc48a
author nkeynes
date Mon Oct 06 01:05:12 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Move bundle/system paths into paths.c, install lxdreamrc into the bundle
(Fix OSX bundle missing default configuration)
file annotate diff log raw
1.1 --- a/src/config.c Mon Jul 21 01:01:39 2008 +0000
1.2 +++ b/src/config.c Mon Oct 06 01:05:12 2008 +0000
1.3 @@ -69,14 +69,18 @@
1.4 lxdream_config_save_filename = g_strdup_printf("%s/.%s", home, DEFAULT_CONFIG_FILENAME);
1.5 }
1.6 if( lxdream_config_load_filename == NULL ) {
1.7 + char *sysconfig = g_strdup_printf("%s/%s", get_sysconf_path(), DEFAULT_CONFIG_FILENAME);
1.8 if( access(lxdream_config_save_filename, R_OK) == 0 ) {
1.9 lxdream_config_load_filename = g_strdup(lxdream_config_save_filename);
1.10 - } else if( access( PACKAGE_CONF_DIR "/" DEFAULT_CONFIG_FILENAME, R_OK ) == 0 ) {
1.11 - lxdream_config_load_filename = g_strdup(PACKAGE_CONF_DIR "/" DEFAULT_CONFIG_FILENAME);
1.12 + g_free(sysconfig);
1.13 + } else if( access( sysconfig, R_OK ) == 0 ) {
1.14 + lxdream_config_load_filename = sysconfig;
1.15 } else if( access( "./" DEFAULT_CONFIG_FILENAME, R_OK ) == 0 ) {
1.16 lxdream_config_load_filename = g_strdup("./" DEFAULT_CONFIG_FILENAME);
1.17 + g_free(sysconfig);
1.18 } else {
1.19 lxdream_config_load_filename = g_strdup(lxdream_config_save_filename);
1.20 + g_free(sysconfig);
1.21 result = FALSE;
1.22 }
1.23 }
.