aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-client.h
diff options
context:
space:
mode:
authorGravatar Jameson Graef Rollins <jrollins@finestructure.net>2011-05-28 14:52:00 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-06-03 15:24:44 -0700
commitd5b4d950245605b84c56ce991fa3c59a073a70e5 (patch)
treedc5d6d4f32cab5e44ffa215da42412b939437f78 /notmuch-client.h
parent61ff61cc2cb12ecc5020477bf8f7c1b4d31f953a (diff)
show: Avoid inadvertently closing stdout
GMime has a nasty habit of taking ownership by default of any FILE* handed to it va g_mime_stream_file_new. Specifically it will close the FILE* when the stream is destroyed---even though GMime didn't open the file itself. To avoid this bad behavior, we have to carefully set_owner(FALSE) after calling g_mime_stream_file_new. In the format_part_content_text function, since commit d92146d3a6809f8ad940302af49cd99a0820665e we've been calling g_mime_stream_file_new unconditionally, but only calling g_mime_stream_file_set_owner(FALSE) conditionally. This led to the FILE* being closed early when notmuch show output was redirected to a file. Fixing this fixes the test-suite cases that broke with the previous commit, (which added redirected "notmuch show" calls to the test suite to expose this bug). Edited-by: Carl Worth <cworth@cworth.org> with a new commit message to explain the bug and fix.
Diffstat (limited to 'notmuch-client.h')
0 files changed, 0 insertions, 0 deletions