[PATCH v2 08/10] notmuch-config: use strchr(), not index() (Solaris support)

Subject: [PATCH v2 08/10] notmuch-config: use strchr(), not index() (Solaris support)

Date: Mon, 5 Nov 2012 11:02:01 -0800

To: notmuch@notmuchmail.org

Cc:

From: Blake Jones


notmuch-config.c has the only use of the function named "index()" in the
notmuch source.  Several other places use the equivalent function
"strchr()"; this patch just fixes notmuch-config.c to use strchr()
instead.  (Solaris needs to include <strings.h> to get the prototype for
index(), and notmuch-config.c was failing to include that header, so it
wasn't compiling as-is.)
---
 notmuch-config.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notmuch-config.c b/notmuch-config.c
index 3e37a2d..47eb743 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -688,7 +688,7 @@ _item_split (char *item, char **group, char **key)
 
     *group = item;
 
-    period = index (item, '.');
+    period = strchr (item, '.');
     if (period == NULL || *(period+1) == '\0') {
 	fprintf (stderr,
 		 "Invalid configuration name: %s\n"
-- 
1.7.3.2


Thread: