Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 43E35431FD0 for ; Sat, 28 May 2011 14:52:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.921 X-Spam-Level: X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iVfYk2N-xuD9 for ; Sat, 28 May 2011 14:52:29 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 27BB7429E38 for ; Sat, 28 May 2011 14:52:17 -0700 (PDT) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id A2023328142; Sat, 28 May 2011 14:45:49 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com [98.149.172.122]) (Authenticated sender: jrollins) by fire-doxen-submit (Postfix) with ESMTP id DD2AC2E50E7E; Sat, 28 May 2011 14:45:46 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id 650699B6; Sat, 28 May 2011 14:52:05 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 25/25] Fix stdout stream grabbing in format_part_content_text Date: Sat, 28 May 2011 14:52:00 -0700 Message-Id: <1306619520-25730-26-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306619520-25730-25-git-send-email-jrollins@finestructure.net> References: <1306619520-25730-1-git-send-email-jrollins@finestructure.net> <1306619520-25730-2-git-send-email-jrollins@finestructure.net> <1306619520-25730-3-git-send-email-jrollins@finestructure.net> <1306619520-25730-4-git-send-email-jrollins@finestructure.net> <1306619520-25730-5-git-send-email-jrollins@finestructure.net> <1306619520-25730-6-git-send-email-jrollins@finestructure.net> <1306619520-25730-7-git-send-email-jrollins@finestructure.net> <1306619520-25730-8-git-send-email-jrollins@finestructure.net> <1306619520-25730-9-git-send-email-jrollins@finestructure.net> <1306619520-25730-10-git-send-email-jrollins@finestructure.net> <1306619520-25730-11-git-send-email-jrollins@finestructure.net> <1306619520-25730-12-git-send-email-jrollins@finestructure.net> <1306619520-25730-13-git-send-email-jrollins@finestructure.net> <1306619520-25730-14-git-send-email-jrollins@finestructure.net> <1306619520-25730-15-git-send-email-jrollins@finestructure.net> <1306619520-25730-16-git-send-email-jrollins@finestructure.net> <1306619520-25730-17-git-send-email-jrollins@finestructure.net> <1306619520-25730-18-git-send-email-jrollins@finestructure.net> <1306619520-25730-19-git-send-email-jrollins@finestructure.net> <1306619520-25730-20-git-send-email-jrollins@finestructure.net> <1306619520-25730-21-git-send-email-jrollins@finestructure.net> <1306619520-25730-22-git-send-email-jrollins@finestructure.net> <1306619520-25730-23-git-send-email-jrollins@finestructure.net> <1306619520-25730-24-git-send-email-jrollins@finestructure.net> <1306619520-25730-25-git-send-email-jrollins@finestructure.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 21:52:30 -0000 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. --- notmuch-show.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index e90f07e..61c6f49 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -447,7 +447,6 @@ format_part_content_text (GMimeObject *part) { GMimeContentDisposition *disposition = g_mime_object_get_content_disposition (part); GMimeContentType *content_type = g_mime_object_get_content_type (GMIME_OBJECT (part)); - GMimeStream *stream_stdout = g_mime_stream_file_new (stdout); printf (", Content-type: %s\n", g_mime_content_type_to_string (content_type)); @@ -462,6 +461,7 @@ format_part_content_text (GMimeObject *part) if (g_mime_content_type_is_type (content_type, "text", "*") && !g_mime_content_type_is_type (content_type, "text", "html")) { + GMimeStream *stream_stdout = g_mime_stream_file_new (stdout); g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE); show_part_content (part, stream_stdout); g_object_unref(stream_stdout); -- 1.7.4.4