forked from ariadne/pkgconf
bsdstubs: nothing seems to use strtok_r() anymore, kill it
parent
8213d91038
commit
b0c821af5c
|
@ -15,7 +15,7 @@ AC_PREREQ([2.68])
|
||||||
AC_INIT([pkgconf], [1.0.1], [http://github.com/pkgconf/pkgconf/issues])
|
AC_INIT([pkgconf], [1.0.1], [http://github.com/pkgconf/pkgconf/issues])
|
||||||
AC_CONFIG_SRCDIR([main.c])
|
AC_CONFIG_SRCDIR([main.c])
|
||||||
AC_CONFIG_HEADERS([libpkgconf/config.h])
|
AC_CONFIG_HEADERS([libpkgconf/config.h])
|
||||||
AC_CHECK_FUNCS([strlcpy strlcat strndup strtok_r])
|
AC_CHECK_FUNCS([strlcpy strlcat strndup])
|
||||||
AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects])
|
AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects])
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
LT_INIT
|
LT_INIT
|
||||||
|
|
|
@ -119,48 +119,6 @@ strndup(const char *src, size_t len)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRTOK_R
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2005-2014 Rich Felker
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
static inline char *
|
|
||||||
strtok_r(char *s, const char *sep, char **p)
|
|
||||||
{
|
|
||||||
if (!s && !(s = *p))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
s += strspn(s, sep);
|
|
||||||
if (!*s)
|
|
||||||
return *p = 0;
|
|
||||||
*p = s + strcspn(s, sep);
|
|
||||||
|
|
||||||
if (**p)
|
|
||||||
*(*p)++ = 0;
|
|
||||||
else
|
|
||||||
*p = 0;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
pkgconf_strlcpy(char *dst, const char *src, size_t siz)
|
pkgconf_strlcpy(char *dst, const char *src, size_t siz)
|
||||||
{
|
{
|
||||||
|
@ -178,9 +136,3 @@ pkgconf_strndup(const char *src, size_t len)
|
||||||
{
|
{
|
||||||
return strndup(src, len);
|
return strndup(src, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
pkgconf_strtok_r(char *s, const char *sep, char **p)
|
|
||||||
{
|
|
||||||
return strtok_r(s, sep, p);
|
|
||||||
}
|
|
||||||
|
|
|
@ -19,6 +19,5 @@
|
||||||
extern size_t pkgconf_strlcpy(char *dst, const char *src, size_t siz);
|
extern size_t pkgconf_strlcpy(char *dst, const char *src, size_t siz);
|
||||||
extern size_t pkgconf_strlcat(char *dst, const char *src, size_t siz);
|
extern size_t pkgconf_strlcat(char *dst, const char *src, size_t siz);
|
||||||
extern char *pkgconf_strndup(const char *src, size_t len);
|
extern char *pkgconf_strndup(const char *src, size_t len);
|
||||||
extern char *pkgconf_strtok_r(char *s, const char *sep, char **p);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue