[PATCH v3 08/10] notmuch-config: use strchr(), not index() (Solaris support)
authorBlake Jones <blakej@foo.net>
Wed, 14 Nov 2012 02:10:03 +0000 (18:10 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:32 +0000 (09:50 -0800)
ce/59c2f02bc41d078aec30391452b8477f00927b [new file with mode: 0644]

diff --git a/ce/59c2f02bc41d078aec30391452b8477f00927b b/ce/59c2f02bc41d078aec30391452b8477f00927b
new file mode 100644 (file)
index 0000000..78ed635
--- /dev/null
@@ -0,0 +1,78 @@
+Return-Path: <blakej@foo.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id AA409431FBC\r
+       for <notmuch@notmuchmail.org>; Tue, 13 Nov 2012 18:10:13 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ldO9uYBzsuOj for <notmuch@notmuchmail.org>;\r
+       Tue, 13 Nov 2012 18:10:13 -0800 (PST)\r
+Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id C84FA431FC0\r
+       for <notmuch@notmuchmail.org>; Tue, 13 Nov 2012 18:10:11 -0800 (PST)\r
+Received: from foo.net (localhost [127.0.0.1])\r
+       by foo.net (8.14.5+Sun/8.14.5) with ESMTP id qAE2AAAX018932;\r
+       Tue, 13 Nov 2012 18:10:10 -0800 (PST)\r
+Received: (from blakej@localhost)\r
+       by foo.net (8.14.5+Sun/8.14.5/Submit) id qAE2AAeX018927;\r
+       Tue, 13 Nov 2012 18:10:10 -0800 (PST)\r
+From: Blake Jones <blakej@foo.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 08/10] notmuch-config: use strchr(),\r
+       not index() (Solaris support)\r
+Date: Tue, 13 Nov 2012 18:10:03 -0800\r
+Message-Id: <1352859005-18631-9-git-send-email-blakej@foo.net>\r
+X-Mailer: git-send-email 1.7.3.2\r
+In-Reply-To: <1352859005-18631-1-git-send-email-blakej@foo.net>\r
+References: <1352859005-18631-1-git-send-email-blakej@foo.net>\r
+X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2\r
+       (foo.net [127.0.0.1]); Tue, 13 Nov 2012 18:10:10 -0800 (PST)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 14 Nov 2012 02:10:13 -0000\r
+\r
+notmuch-config.c has the only use of the function named "index()" in the\r
+notmuch source.  Several other places use the equivalent function\r
+"strchr()"; this patch just fixes notmuch-config.c to use strchr()\r
+instead.  (Solaris needs to include <strings.h> to get the prototype for\r
+index(), and notmuch-config.c was failing to include that header, so it\r
+wasn't compiling as-is.)\r
+---\r
+ notmuch-config.c |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index 3e37a2d..47eb743 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -688,7 +688,7 @@ _item_split (char *item, char **group, char **key)\r
\r
+     *group = item;\r
\r
+-    period = index (item, '.');\r
++    period = strchr (item, '.');\r
+     if (period == NULL || *(period+1) == '\0') {\r
+       fprintf (stderr,\r
+                "Invalid configuration name: %s\n"\r
+-- \r
+1.7.3.2\r
+\r