From: uranther Date: Wed, 3 Jun 2009 22:34:25 +0000 (-0400) Subject: fixed some Glib CRITICAL errors coming from the get_xdg_var() function when actual_va... X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=de5ccaf4fbe7ba410b4759b601ad5ff01e3d4138;p=uzbl-mobile fixed some Glib CRITICAL errors coming from the get_xdg_var() function when actual_value="" is passed to str_replace() --- diff --git a/uzbl.c b/uzbl.c index c6f65f3..3e23cde 100644 --- 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; }