Re: [evolution-patches] patch for bug #305304



Since gstrings already manage growing the string, etc, a much cleaner
version would be:

temp = e_gw_item_get_message(item);
if (temp) {
	g_string_append(str, "DESCRIPTION:");
	while (*temp) {
		if (*temp == '\n')
			g_string_append(str, "\\n");
		else
			g_string_append_c(str, *temp);
		temp++;
	}
	g_string_append(str, "\n");
}

This is basically why the code already uses a gstring, because it needs
to incrementally build the data.

I definitely wouldn't accept the patch supplied, its own memory
management is prone to error, and it even leaks the one allocation it
does make.  Not to mention some other logic problems.


On Thu, 2005-08-04 at 02:40 -0600, Dinesh Layek wrote:
> hi all
> 
>   Attached is the patch to fix bug number 305304.
>   The '\n' character of description-field is
>   separately  encoded as '\' and 'n'.
>   Please review.
> 
> Regards,
> 
> 
> Dinesh Layek
> Novell Software Developement(I) Pvt. Ltd,
> www.novell.com
> Phone No. 080-25731856 Extn. 2140
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]