# HG changeset patch # User Luke Schierer # Date 1053881555 0 # Node ID d1524728d491613b1620a911362aaea762df3c46 # Parent e41b04bb4afe61c8158b332e5146dc05ad8c9ed7 [gaim-migrate @ 5912] Dario Sarango (darius_wolfson) patched bug 743000 writting: "Summary: scans the manual browser command for multiple %s. If multiple %s are found, error message is given and the web_command is not executed. " committer: Tailor Script diff -r e41b04bb4afe -r d1524728d491 src/browser.c --- a/src/browser.c Sun May 25 13:53:11 2003 +0000 +++ b/src/browser.c Sun May 25 16:52:35 2003 +0000 @@ -585,6 +585,7 @@ case BROWSER_MANUAL: { char *space_free_url = NULL; + char *web_tmp = NULL; if (!web_command[0]) { gaim_notify_error(NULL, NULL, @@ -597,11 +598,26 @@ space_free_url = g_strdup(url); g_strdelimit(space_free_url, " ", '+'); - if(strstr(web_command, "%s")) + /* + 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); + } else command = g_strdup_printf("%s %s", web_command, space_free_url); g_free(space_free_url); + g_free(web_tmp); } break; }