Re: [PATCH 08/10] notmuch-config: header for index() prototype (Solaris support)

Subject: Re: [PATCH 08/10] notmuch-config: header for index() prototype (Solaris support)

Date: Sun, 04 Nov 2012 23:16:50 +0200

To: Blake Jones, notmuch@notmuchmail.org

Cc:

From: Jani Nikula


On Sun, 04 Nov 2012, Blake Jones <blakej@foo.net> wrote:
> Linux, FreeBSD, and Solaris all expect to find the prototype for
> "index()" in <strings.h>.  On some operating systems, including
> <string.h> is sufficient to get the prototype, but that's not the case
> on Solaris.  This patch just modifies notmuch-config.c to include
> <strings.h> to get the prototype.

We should probably just nuke index() and use strchr() instead.

Jani.


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"

Thread: