diff --git a/configure.ac b/configure.ac index 8624fe4..41cf997 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ AC_PREREQ([2.68]) AC_INIT([pkgconf], [1.0.1], [http://github.com/pkgconf/pkgconf/issues]) AC_CONFIG_SRCDIR([main.c]) 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_SILENT_RULES([yes]) LT_INIT diff --git a/libpkgconf/bsdstubs.c b/libpkgconf/bsdstubs.c index 9abeeb3..8f70ff3 100644 --- a/libpkgconf/bsdstubs.c +++ b/libpkgconf/bsdstubs.c @@ -119,48 +119,6 @@ strndup(const char *src, size_t len) } #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 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); } - -char * -pkgconf_strtok_r(char *s, const char *sep, char **p) -{ - return strtok_r(s, sep, p); -} diff --git a/libpkgconf/bsdstubs.h b/libpkgconf/bsdstubs.h index c878138..fe8c950 100644 --- a/libpkgconf/bsdstubs.h +++ b/libpkgconf/bsdstubs.h @@ -19,6 +19,5 @@ 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 char *pkgconf_strndup(const char *src, size_t len); -extern char *pkgconf_strtok_r(char *s, const char *sep, char **p); #endif