Re: [evolution-patches] fix for bug #41407



looks good.  oops.

On Thu, 2003-04-17 at 05:42, Jeffrey Stedfast wrote:
> http://bugzilla.ximian.com/show_bug.cgi?id=41407
> 
> the tohtml filter was adding a "<br>\n" to the end of each header line
> that we converted to HTML and then there was code in the mailer to
> append a "<br>" between each header, resulting in a double blank line
> between each header.
> 
> Fixed up the test suite's html.1.out file to not contain a \n at EOF
> since the input file does not contain one.
> 
> The fix was just to check that the input stream contained a \n before
> appending "<br>\n" (when flags & CONVERT_NL) or appending "\n" when
> CONVERT_NL was not set.
> 
> 
> 
> -- 
> Jeffrey Stedfast
> Evolution Hacker - Ximian, Inc.
> fejj ximian com  - www.ximian.com
> 
> ______________________________________________________________________
> 
> ? 41407.patch
> ? ChangeLog.nonximian
> ? body
> ? body.c
> ? body.txt
> ? camel-mime-filter-windows.c
> ? camel-mime-filter-windows.h
> ? charset-map.c
> ? charset-map.diff
> ? cmsutil.c
> ? date.patch
> ? evolution-1.3-gpg.patch
> ? folder-info-build.patch
> ? foo
> ? gpg-verify.patch
> ? html-filter-broken.msg
> ? imap
> ? invalid-content-id.patch
> ? iso
> ? iso.c
> ? pop3-uidl.patch
> ? smime
> ? win-charset.patch
> ? tests/mime-filter/test-tohtml
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
> retrieving revision 1.1795
> diff -u -r1.1795 ChangeLog
> --- ChangeLog	16 Apr 2003 17:02:09 -0000	1.1795
> +++ ChangeLog	16 Apr 2003 20:00:43 -0000
> @@ -1,3 +1,14 @@
> +2003-04-16  Jeffrey Stedfast  <fejj ximian com>
> +
> +	* tests/mime-filter/data/html.1.out: Removed a trailing \n at the
> +	end of the file, this is incorrect (since out input file does not
> +	contain one).
> +
> +	* camel-mime-filter-tohtml.c (html_convert): Only output a <br> if
> +	we found an eoln in the input. Along the same lines, don't write a
> +	'\n' to the output buffer unless we've encountered that eoln in
> +	the input. Fixes bug #41407.
> +
>  2003-04-15  Jeffrey Stedfast  <fejj ximian com>
>  
>  	* camel-gpg-context.c (gpg_verify): The gpg child process exiting
> Index: camel-mime-filter-tohtml.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/camel/camel-mime-filter-tohtml.c,v
> retrieving revision 1.12
> diff -u -r1.12 camel-mime-filter-tohtml.c
> --- camel-mime-filter-tohtml.c	10 Apr 2003 11:34:57 -0000	1.12
> +++ camel-mime-filter-tohtml.c	16 Apr 2003 20:00:43 -0000
> @@ -320,12 +320,15 @@
>  			outptr = g_stpcpy (outptr, "</font>");
>  		}
>  		
> -		if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_NL) {
> -			outptr = check_size (filter, outptr, &outend, 5);
> -			outptr = g_stpcpy (outptr, "<br>");
> +		if (inptr < inend) {
> +			if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_NL) {
> +				outptr = check_size (filter, outptr, &outend, 5);
> +				outptr = g_stpcpy (outptr, "<br>");
> +			}
> +			
> +			*outptr++ = '\n';
>  		}
>  		
> -		*outptr++ = '\n';
>  		start = ++inptr;
>  	} while (inptr < inend);
>  	
> Index: tests/mime-filter/data/html.1.out
> ===================================================================
> RCS file: /cvs/gnome/evolution/camel/tests/mime-filter/data/html.1.out,v
> retrieving revision 1.1
> diff -u -r1.1 html.1.out
> --- tests/mime-filter/data/html.1.out	10 Apr 2003 11:35:00 -0000	1.1
> +++ tests/mime-filter/data/html.1.out	16 Apr 2003 20:00:44 -0000
> @@ -7,4 +7,4 @@
>  They can also be found on the web at:
>  
>  &#9;&lt;<a href="http://www.ce.udel.edu/teaching_award.html";>http://www.ce.udel.edu/teaching_award.html</a>&gt;
> -&#9;&lt;<a href="http://www.ce.udel.edu/nomination_form.html";>http://www.ce.udel.edu/nomination_form.html</a>&gt;
> +&#9;&lt;<a href="http://www.ce.udel.edu/nomination_form.html";>http://www.ce.udel.edu/nomination_form.html</a>&gt;
> \ No newline at end of file




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