From ac8a0175beb365a0b421ae7f1cf6852fba9827c6 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 31 May 2012 18:09:23 +0300 Subject: [PATCH] Only use local mempcpy() if system libraries dont provide one - Obvious yes, but how come this didn't barf on my other rather identical system? Meh. --- configure.ac | 1 + rpmio/rpmglob.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index dd90d3466..5a0deea87 100644 --- a/configure.ac +++ b/configure.ac @@ -478,6 +478,7 @@ dnl Checks for library functions. AC_FUNC_MMAP AC_CHECK_FUNCS(putenv) +AC_CHECK_FUNCS(mempcpy) AC_REPLACE_FUNCS(stpcpy stpncpy) diff --git a/rpmio/rpmglob.c b/rpmio/rpmglob.c index d58f38c12..4fc106daf 100644 --- a/rpmio/rpmglob.c +++ b/rpmio/rpmglob.c @@ -110,10 +110,12 @@ static int glob_in_dir(const char *pattern, const char *directory, static int prefix_array(const char *prefix, char **array, size_t n); static int collated_compare(const void *, const void *); +#ifndef HAVE_MEMPCPY static void * mempcpy(void *dest, const void *src, size_t n) { return (char *) memcpy(dest, src, n) + n; } +#endif /* Find the end of the sub-pattern in a brace expression. We define this as an inline function if the compiler permits. */