diff options
author | Josh Rickmar <jrick@devio.us> | 2012-06-02 09:19:18 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@devio.us> | 2012-06-06 11:53:15 -0400 |
commit | 3298d9a24118b28173f3b606d7aed8fd8fee44f7 (patch) | |
tree | bb5e927809fca58b60900377297dbec27525b32b /about.c | |
parent | 1c7e8125fad4f52d6db3a9d61b5b625ca73a57ad (diff) | |
download | xombrero-3298d9a24118b28173f3b606d7aed8fd8fee44f7.tar.gz |
This fixes a bunch of things that probably should have gone in my last
push. Make the set_ssl_ca_file pointer logic not suck. 'M' isn't a valid key modifier, use 'M1' in the manpage. Add a function to escape an html string and use this for displaying settings. Now things like <file> and <uri> are not interpreted as html tags. Kill a system() when running a custom uri script. Tildes are now also expanded instead of being interpreted by the no-longer-being-called system shell. Plug a leak Replace the system() call for external_editor with an execvp and while here, kill a dangerous sprintf. Remove an unused variable
Diffstat (limited to 'about.c')
-rw-r--r-- | about.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/about.c b/about.c index 64e6804..012e52e 100644 --- a/about.c +++ b/about.c @@ -732,11 +732,6 @@ xtp_handle_ab(struct tab *t, uint8_t cmd, int arg) show_oops(t, "external_editor is unset"); break; } - snprintf(config, sizeof config, "%s" PS ".%s", pwd->pw_dir, - XT_CONF_FILE); - sv = g_strsplit(external_editor, "<file>", -1); - cmdstr = g_strjoinv(config, sv); - g_strfreev(sv); switch (pid = fork()) { case -1: /* no process created */ @@ -744,9 +739,18 @@ xtp_handle_ab(struct tab *t, uint8_t cmd, int arg) break; case 0: /* child */ + snprintf(config, sizeof config, "%s" PS ".%s", + pwd->pw_dir, XT_CONF_FILE); + + sv = g_strsplit(external_editor, "<file>", -1); + cmdstr = g_strjoinv(config, sv); + g_strfreev(sv); + sv = g_strsplit_set(cmdstr, " \t", -1); + execvp(sv[0], sv); g_strfreev(sv); + g_free(cmdstr); _exit(0); default: /* parent */ |