]> git.notmuchmail.org Git - notmuch/commitdiff
Setup the GMimeStream only when needed
authornstraz@redhat.com <nstraz@redhat.com>
Thu, 1 Apr 2010 13:47:21 +0000 (09:47 -0400)
committerCarl Worth <cworth@cworth.org>
Thu, 1 Apr 2010 21:27:01 +0000 (14:27 -0700)
I ran into this while looking at the vim plugin.  Vim's system() call
redirects output to a file and it was missing many of the part{ lines.

If stream_stdout is setup too early, it will overwrite the part start
when notmuch is redirected to a file.

Reviewed-by Carl Worth <cworth@cworth.org>: GMime is calling fseek
before every write to reset the FILE* to the position it believes is
correct based on the writes it has seen. Our code was getting
incorrect results because our GMime writes were interleaved with
non-GMime writes via printf.

The bug appears when writing to a file because it's seekable, but not
when writing to a pipe which is not.


No differences found