aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar uranther <jwheaton@purdue.edu>2009-06-03 18:34:25 -0400
committerGravatar uranther <jwheaton@purdue.edu>2009-06-03 18:34:25 -0400
commitde5ccaf4fbe7ba410b4759b601ad5ff01e3d4138 (patch)
treed85d7c5633d32721160e10982795e5f52924e1b8 /uzbl.c
parentfe39c93e90825edc92c73f2185e2c1cef5ae87e6 (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.c6
1 files changed, 4 insertions, 2 deletions
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;
}