fixed some Glib CRITICAL errors coming from the get_xdg_var() function when actual_va...
authoruranther <jwheaton@purdue.edu>
Wed, 3 Jun 2009 22:34:25 +0000 (18:34 -0400)
committeruranther <jwheaton@purdue.edu>
Wed, 3 Jun 2009 22:34:25 +0000 (18:34 -0400)
uzbl.c

diff --git a/uzbl.c b/uzbl.c
index c6f65f3..3e23cde 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -2167,8 +2167,7 @@ static gchar*
 get_xdg_var (XDG_Var xdg) {
     const gchar* actual_value = getenv (xdg.environmental);
     const gchar* home         = getenv ("HOME");
-
-    gchar* return_value = str_replace ("~", home, actual_value);
+    gchar* return_value;
 
     if (! actual_value || strcmp (actual_value, "") == 0) {
         if (xdg.default_value) {
@@ -2176,7 +2175,10 @@ get_xdg_var (XDG_Var xdg) {
         } else {
             return_value = NULL;
         }
+    } else {
+        return_value = str_replace("~", home, actual_value);
     }
+
     return return_value;
 }