Re: [PATCH 25/25] Fix stdout stream grabbing in format_part_content_text

Subject: Re: [PATCH 25/25] Fix stdout stream grabbing in format_part_content_text

Date: Fri, 03 Jun 2011 14:26:48 -0700

To: Carl Worth, Notmuch Mail

Cc:

From: Jameson Graef Rollins


On Fri, 03 Jun 2011 12:56:50 -0700, Carl Worth <cworth@cworth.org> wrote:
> On Sat, 28 May 2011 14:52:00 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> > The declaration of the GMimeStream pointer to stdout in
> > format_part_content_text was somehow preventing subsequent printf
> > calls from outputting to stdout if the output was redirected to a
> > file.  Scoping the declaration to the actual use of the stream pointer
> > works around this problem.
> 
> This commit message sounds like we don't actually understand the problem
> being fixed here.

Well actually it's only meant to sound like the committer doesn't
understand the problem!

> I'd like to investigate this more. Perhaps with a test case?

The current tests are how I found the problem!  Without this patch at
least the multipart tests will fail.  I don't see how another test will
add anything.

Carl, if you (or anyone else) understands what the issue is, then please
go ahead and modify the commit message.  I don't understand things
enough myself to do any better.  Clearly there is some strange
interaction with things that try to use stdout after
g_mime_stream_file_new() has already grabbed it.

I really wouldn't block on this, though, since the patch does fix an
actual bug.

jamie.
part-000.sig (application/pgp-signature)

Thread: