[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] why no strchr or strrchr?

From: Jim Meyering
Subject: Re: [Bug-gnulib] why no strchr or strrchr?
Date: Mon, 23 Aug 2004 13:39:41 +0200

Oskar Liljeblad <address@hidden> wrote:
> Is there any particular reason strchr and strrchr are not implemented
> in gnulib? autoconf suggests using these tests for strchr and strrchr:

Probably because every useful system has working versions already.

> configure.ac:
>           AC_HEADER_STDC
>           AC_CHECK_FUNCS(strchr strrchr)
> header file:
>           #if STDC_HEADERS
>           # include <string.h>
>           #else
>           # if !HAVE_STRCHR
>           #  define strchr index
>           #  define strrchr rindex
>           # endif
>           char *strchr (), *strrchr ();
>           #endif
> So maybe there would be a point implementing it - either as a real
> function or just as strchr.h?

IMHO, those examples are no longer useful for more than historical
reference.  I seem to have removed all rindex/index/bcmp/bcopy/bzero
references from the fileutils in 1995.  I haven't looked back since.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]