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

Tomi Ollila tomi.ollila at iki.fi
Sun Nov 4 13:47:15 PST 2012


On Sun, Nov 04 2012, Jani Nikula wrote:

> On Sun, 04 Nov 2012, Blake Jones <blakej at 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.

indeed!

>
> Jani.
>

Tomi


>
> 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"
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list