diff options
author | uranther <jwheaton@purdue.edu> | 2009-06-03 18:34:25 -0400 |
---|---|---|
committer | uranther <jwheaton@purdue.edu> | 2009-06-03 18:34:25 -0400 |
commit | de5ccaf4fbe7ba410b4759b601ad5ff01e3d4138 (patch) | |
tree | d85d7c5633d32721160e10982795e5f52924e1b8 /uzbl.c | |
parent | fe39c93e90825edc92c73f2185e2c1cef5ae87e6 (diff) |
fixed some Glib CRITICAL errors coming from the get_xdg_var() function when actual_value="" is passed to str_replace()
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |