aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--uzbl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/uzbl.c b/uzbl.c
index 47f5e22..9ce5669 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -401,10 +401,16 @@ settings_init () {
gchar** keyse = NULL;
if (! config_file) {
- char* conf = getenv ("XDG_CONFIG_HOME");
- strcat (conf, "/uzbl");
- if (file_exists (conf))
- strcpy(config_file conf);
+ char* xdg = getenv ("XDG_CONFIG_HOME");
+ char* conf = NULL;
+ if (xdg) {
+ strcpy (conf, xdg);
+ strcat (conf, "/uzbl");
+ if (file_exists (conf)) {
+ printf ("Config file %s found.", conf);
+ strcpy(config_file, conf);
+ }
+ }
}
if (config_file) {