Re: [PATCH] compat: add memrchr()
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Oct 15, 2010, 05:31 UTC
- Message-ID
- <AANLkTinBuAhLLUMLd6ZWtVFWCjnFAxYwVSo1Pkja7bT4@mail.gmail.com>
- In-Reply-To
- <20101015051750.GA21830@burratino>
On Fri, Oct 15, 2010 at 05:17, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 7 quoted lines
> Reimplement another handy convenience function from glibc. memrchr() > searches from the end of a memory area for a particular character. It > is similar to strrchr() but takes a length argument and is > binary-safe. > > The whole-directory rename detection patch could use this to find the > last directory separator in a (possibly truncated) pathname.
Maybe something like this for configure.ac:
AC_CHECK_LIB([c], [memchr],
[HAVE_MEMRCHR=YesPlease],
[HAVE_MEMRCHR=])
AC_SUBST(HAVE_MEMRCHR)And documentation with the other HAVE_* variables at the top of the Makefile?