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

Blake Jones blakej at foo.net
Mon Nov 5 11:02:01 PST 2012


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



More information about the notmuch mailing list