From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 3B5ED6DE1087 for ; Thu, 30 May 2019 18:19:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.187 X-Spam-Level: X-Spam-Status: No, score=-0.187 tagged_above=-999 required=5 tests=[AWL=0.014, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o8WeCW4pRNaD for ; Thu, 30 May 2019 18:19:00 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 144CB6DE107D for ; Thu, 30 May 2019 18:18:59 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1559265537; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding : from; bh=8XXbk7b7BXnwgZsBQvDl88xpLy1Q/ZdqnpcdVIQBonA=; b=AXSmlcKr5XTVZhAFxC5yLWZHKwa4bnFxxxMjbWcHy/wueTSj719xNv3p sMrsa4m5Ars1cd2yULsUQuoxMDVbDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1559265537; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding : from; bh=8XXbk7b7BXnwgZsBQvDl88xpLy1Q/ZdqnpcdVIQBonA=; b=lst8ldG+wqwf7RiC3CzV0Sj/r70aUOBdi1/TNkm08+oKedfDl6AeOVgd U8uQhSlGUGxiZivth8ChDFEvaQxc3bk7+cpI3lkZUeqjAh0jI/ncpQS13h YSClS/27thBuXDjlYoUF+XKqUf+SKElUdZGAIdVHiDBTrZMCxLR1VFFC62 LodC1eL2xDyL/Uv2kfbxZ7lJNeR0ali2JNQyZVs80BFwhtvjCLtsf4iyCP fzn03LHDdpIfzeB5IDKVIZFh021S/RHbT6QPPBFZklR0ii4W1Go1/loGIq yCDYYiGMshTfH7TquNpAi/5s3g1IL5WNdBXf4wUumJJi7Yvb3oVVkQ== Received: from fifthhorseman.net (unknown [38.109.115.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 778A9F99D for ; Thu, 30 May 2019 21:18:56 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id C23D22031C; Thu, 30 May 2019 21:18:53 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH] mime-node: be clearer about decryption Date: Thu, 30 May 2019 21:18:53 -0400 Message-Id: <20190531011853.27789-1-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Fri, 31 May 2019 01:19:01 -0000 Part 0 of a multipart/encrypted object is GMIME_MULTIPART_ENCRYPTED_VERSION; part 1 is GMIME_MULTIPART_ENCRYPTED_CONTENT. Using the name for what we want describes our intent more clearly than using a magic number in the code. Signed-off-by: Daniel Kahn Gillmor --- mime-node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mime-node.c b/mime-node.c index 3492bcd0..a93cbb31 100644 --- a/mime-node.c +++ b/mime-node.c @@ -339,7 +339,7 @@ mime_node_child (mime_node_t *parent, int child) return NULL; if (GMIME_IS_MULTIPART (parent->part)) { - if (child == 1 && parent->decrypted_child) + if (child == GMIME_MULTIPART_ENCRYPTED_CONTENT && parent->decrypted_child) sub = parent->decrypted_child; else sub = g_mime_multipart_get_part -- 2.20.1