about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-11-26 10:43:19 +0000
committerJames Booth <boothj5@gmail.com>2012-11-26 10:43:19 +0000
commit0e178ab411c630c299dd41fae3e265116b27d5eb (patch)
treed16ebf8d387e0f762b920aab97b3bcc8e54f9f42 /src
parent56e5d16938ad495884920a90f876948b52d979d2 (diff)
downloadprofani-tty-0e178ab411c630c299dd41fae3e265116b27d5eb.tar.gz
Fixed GLib assertion error when no XDG env set
Diffstat (limited to 'src')
-rw-r--r--src/xdg_base.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xdg_base.c b/src/xdg_base.c
index b71e39d1..b2303dee 100644
--- a/src/xdg_base.c
+++ b/src/xdg_base.c
@@ -29,7 +29,8 @@ gchar *
 xdg_get_config_home(void)
 {
     gchar *xdg_config_home = getenv("XDG_CONFIG_HOME");
-    g_strstrip(xdg_config_home);
+    if (xdg_config_home != NULL)
+        g_strstrip(xdg_config_home);
 
     if ((xdg_config_home != NULL) && (strcmp(xdg_config_home, "") != 0)) {
         return strdup(xdg_config_home);
@@ -47,7 +48,8 @@ gchar *
 xdg_get_data_home(void)
 {
     gchar *xdg_data_home = getenv("XDG_DATA_HOME");
-    g_strstrip(xdg_data_home);
+    if (xdg_data_home != NULL)
+        g_strstrip(xdg_data_home);
 
     if ((xdg_data_home != NULL) && (strcmp(xdg_data_home, "") != 0)) {
         return strdup(xdg_data_home);