[Geany-devel] GeanySendMail: Adding a workaround for a weird issue in connection with utils_string_replace_all(). (was SF.net SVN: geany-plugins:[2214] trunk/geany-plugins/geanysendmail)

Colomban Wendling lists.ban at xxxxx
Sun Sep 25 18:07:25 UTC 2011


Le 25/09/2011 18:59, frlan at users.sourceforge.net a écrit :
> Revision: 2214
>           http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2214&view=rev
> Author:   frlan
> Date:     2011-09-25 16:59:59 +0000 (Sun, 25 Sep 2011)
> Log Message:
> -----------
> GeanySendMail: Adding a workaround for a weird issue in connection with utils_string_replace_all().
> [...]
> @@ -149,8 +148,11 @@
>  			else
>  			{
>  				/* Removes %r if option was not activ but was included into command */
> -				utils_string_replace_all(cmd_str, "%r", NULL);
> +				gchar *tmp_fix;
> +				tmp_fix = g_strdup("");
> +				utils_string_replace_all(cmd_str, "%r", tmp_fix);
>  				g_free(address);
> +				g_free(tmp_fix);

No need to duplicate tmp_fix, passing "" directly is OK, a constant
string is expected:

utils_string_replace_all(cmd_str, "%r", "");

Cheers,
Colomban



More information about the Devel mailing list