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 422334196F0 for ; Tue, 27 Apr 2010 05:57:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 IhpHCIYLA5Ja for ; Tue, 27 Apr 2010 05:57:32 -0700 (PDT) Received: from homiemail-a13.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by olra.theworths.org (Postfix) with ESMTP id 60E17431FC1 for ; Tue, 27 Apr 2010 05:57:32 -0700 (PDT) Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) (Authenticated sender: sebastian@sspaeth.de) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTPA id 93A686A806F; Tue, 27 Apr 2010 05:57:30 -0700 (PDT) From: Sebastian Spaeth To: Notmuch developer list Subject: [PATCH] Rename already used counter var i Date: Tue, 27 Apr 2010 14:57:25 +0200 Message-Id: <1272373045-29268-1-git-send-email-Sebastian@SSpaeth.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <87tyqxmdw6.fsf@yoom.home.cworth.org> References: <87tyqxmdw6.fsf@yoom.home.cworth.org> 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: Tue, 27 Apr 2010 12:57:33 -0000 From: Aneesh Kumar K.V i is already used in a for loop at this point, so using i here again broke notmuch-reply (it would just hang). Use j instead of i here. Signed-off-by: Sebastian Spaeth --- Aneesh noticed this bug and provided a fix for it. IMO it warrants a 0.3.1 release. notmuch-reply hanging indefinitely is not going to make grumpy editors happy. Also despite a documentation blurb above the main snippet of code, I find it pretty much black magic what is being done here. But then I don't really know C.... notmuch-reply.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 333e945..fd1de3b 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -317,7 +317,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message char *domain=NULL; char *tld=NULL; const char *delim=". \t"; - size_t i,other_len; + size_t i,j,other_len; const char *to_headers[] = {"Envelope-to", "X-Original-To"}; @@ -348,10 +348,10 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message free(tohdr); return primary; } - for (i = 0; i < other_len; i++) - if (strcasestr (tohdr, other[i])) { + for (j = 0; j < other_len; j++) + if (strcasestr (tohdr, other[j])) { free(tohdr); - return other[i]; + return other[j]; } free(tohdr); } -- 1.7.0.4