diff options
author | Brendan Taylor <whateley@gmail.com> | 2009-07-08 19:23:33 -0600 |
---|---|---|
committer | Brendan Taylor <whateley@gmail.com> | 2009-07-08 19:23:33 -0600 |
commit | 9483c1c817b98fcc44fb68ae84607eeaf04e884c (patch) | |
tree | dfa1f97870e1b1931281d1dcf5ecdffe22c47bcd /uzbl.c | |
parent | 396043a1fd05a10f27c6eb17b09dbb6df6011cca (diff) |
strip trailing newline from @()@ expansions
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -322,9 +322,13 @@ expand(char *s, guint recurse, gboolean escape_markup) { g_error_free (err); } else if (*cmd_stdout) { + int len = strlen(cmd_stdout); + + if(cmd_stdout[len-1] == '\n') + cmd_stdout[--len] = 0; /* strip trailing newline */ + if(escape_markup) { - char *b = g_markup_escape_text(cmd_stdout, - strlen(cmd_stdout)); + char *b = g_markup_escape_text(cmd_stdout, len); g_string_append(buf, b); g_free(b); } else { |