]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
notmuch-config: use strchr(), not index() (Solaris support)
authorBlake Jones <blakej@foo.net>
Wed, 14 Nov 2012 02:10:03 +0000 (18:10 -0800)
committerDavid Bremner <bremner@debian.org>
Sat, 24 Aug 2013 09:37:51 +0000 (11:37 +0200)
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

index befe9b5b5c8a45a084d7a3fd2738b5344fa4a7bb..6845e3c3db5d3af6f5a9d25f39d4eb8060a1e41a 100644 (file)
@@ -704,7 +704,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"