[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)

Frank Lanitz frank at xxxxx
Sun Sep 25 19:56:38 UTC 2011


On Sun, 25 Sep 2011 20:07:25 +0200
Colomban Wendling <lists.ban at herbesfolles.org> wrote:

> 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", "");


Yepp, you are right. Will change it. Thanks for the hint (and I don't
tell anybody that I used it this way a couple of time in my other
plugins .... ;) )

Cheers, 
Frank 

-- 
http://frank.uvena.de/en/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20110925/b165e6c9/attachment.pgp>


More information about the Devel mailing list