Mercurial > pidgin.yaz
diff src/browser.c @ 5515:439a05a6b409
[gaim-migrate @ 5914]
This makes the manual browser setting good.
-You can have multiple %s's in a browser command (I don't know why you
would want to, but you can)
-It doesn't double-free memory and cause gaim to crash
-If there is no %s, it adds the URL to the end of the command (it did
this before, I'm just re-iterating that it still works)
-It's fewer lines of code and it's cleaner, I think
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 25 May 2003 18:35:24 +0000 |
parents | d1524728d491 |
children | 7a64114641c3 |
line wrap: on
line diff
--- a/src/browser.c Sun May 25 17:06:30 2003 +0000 +++ b/src/browser.c Sun May 25 18:35:24 2003 +0000 @@ -584,9 +584,6 @@ break; case BROWSER_MANUAL: { - char *space_free_url = NULL; - char *web_tmp = NULL; - if (!web_command[0]) { gaim_notify_error(NULL, NULL, _("Unable to launch your browser because " @@ -596,28 +593,12 @@ return; } - space_free_url = g_strdup(url); - g_strdelimit(space_free_url, " ", '+'); - /* if (strstr(web_command, "%s")) - command = g_strdup_printf(web_command, space_free_url); - - Replaced the above with the following to avoid users - from entering more than one %s as part of the browser - command. - */ - web_tmp = strstr(web_command, "%s"); - if(web_tmp) - { - if (strstr((web_tmp + 1), "%s")) - command = g_strdup_printf(web_command, space_free_url); - else - gaim_notify_error(NULL, NULL, _("Unable to launch your browser because the 'Manual' browser command has too many '%s'."), NULL); - } + command = gaim_strreplace(web_command, "%s", url); else - command = g_strdup_printf("%s %s", web_command, space_free_url); - g_free(space_free_url); - g_free(web_tmp); + /* There is no "%s" in the browser command. Assume the user + * wanted the URL tacked on to the end of the command. */ + command = g_strdup_printf("%s %s", web_command, url); } break; }