diff options
author | Brendan Taylor <whateley@gmail.com> | 2009-07-08 21:45:07 -0600 |
---|---|---|
committer | Brendan Taylor <whateley@gmail.com> | 2009-07-08 21:45:07 -0600 |
commit | f77af67457a2a9ceb5e49b796ef339bd0afbdd77 (patch) | |
tree | 5b65dea98f9567fca218384f542672bab371c842 | |
parent | f60b8c882034190252cc465c33606ccc9ae79a74 (diff) |
expand: append "" for a NULL string var
-rw-r--r-- | uzbl.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -290,7 +290,7 @@ expand(char *s, guint recurse, gboolean escape_markup) { if(etype == EXP_SIMPLE_VAR || etype == EXP_BRACED_VAR) { if( (c = g_hash_table_lookup(uzbl.comm.proto_var, ret)) ) { - if(c->type == TYPE_STR) { + if(c->type == TYPE_STR && *c->ptr != NULL) { if(escape_markup) { char *b = g_markup_escape_text((gchar *)*c->ptr, strlen((gchar *)*c->ptr)); @@ -299,7 +299,7 @@ expand(char *s, guint recurse, gboolean escape_markup) { } else { g_string_append(buf, (gchar *)*c->ptr); } - } else if(c && c->type == TYPE_INT) { + } else if(c->type == TYPE_INT) { char *b = itos((uintptr_t)*c->ptr); g_string_append(buf, b); g_free(b); |