* configure.ac: Check for stpcpy() support.

* src/misc.c (stpcpy): Define it if not provided.
This commit is contained in:
Paul Smith 2022-07-04 18:10:08 -04:00
parent 6f7e06ec4e
commit e33af0fb4a
2 changed files with 17 additions and 2 deletions

View file

@ -133,8 +133,8 @@ AS_IF([test "$ac_cv_func_gettimeofday" = yes],
[Define to 1 if you have a standard gettimeofday function])
])
AC_CHECK_FUNCS([strtoll strdup strndup memrchr mempcpy umask mkstemp mktemp \
fdopen dup dup2 getcwd realpath sigsetmask sigaction \
AC_CHECK_FUNCS([strtoll strdup strndup stpcpy memrchr mempcpy umask mkstemp \
mktemp fdopen dup dup2 getcwd realpath sigsetmask sigaction \
getgroups seteuid setegid setlinebuf setreuid setregid \
getrlimit setrlimit setvbuf pipe strerror strsignal \
lstat readlink atexit isatty ttyname pselect posix_spawn \

View file

@ -636,6 +636,21 @@ mempcpy (void *dest, const void *src, size_t n)
}
#endif
#if !HAVE_STPCPY
char *
stpcpy (char *dest, const char *src)
{
char *d = dest;
const char *s = src;
do
*d++ = *s;
while (*s++ != '\0');
return d - 1;
}
#endif
#if !HAVE_STRTOLL
# undef UNSIGNED
# undef USE_NUMBER_GROUPING