diff options
author | Werner Koch <wk@gnupg.org> | 2006-10-02 13:54:35 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2006-10-02 13:54:35 +0200 |
commit | 4b48bcacc9a242365e85ca788c4c966d8aeb1c10 (patch) | |
tree | 21e803ec571bbe4d9288e014a16ccafe0ac45056 /gl | |
parent | 2006-10-02 Marcus Brinkmann <marcus@g10code.de> (diff) | |
download | gnupg2-4b48bcacc9a242365e85ca788c4c966d8aeb1c10.tar.xz gnupg2-4b48bcacc9a242365e85ca788c4c966d8aeb1c10.zip |
Fix for bug 537
Diffstat (limited to 'gl')
-rw-r--r-- | gl/Makefile.am | 14 | ||||
-rw-r--r-- | gl/m4/gnulib.m4 | 4 | ||||
-rw-r--r-- | gl/m4/strpbrk.m4 | 16 | ||||
-rw-r--r-- | gl/m4/strsep.m4 | 17 | ||||
-rw-r--r-- | gl/strpbrk.c | 42 | ||||
-rw-r--r-- | gl/strpbrk.h | 28 | ||||
-rw-r--r-- | gl/strsep.c | 55 | ||||
-rw-r--r-- | gl/strsep.h | 52 |
8 files changed, 2 insertions, 226 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am index be8e6a5b6..dceae98b3 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -9,7 +9,7 @@ # # Generated by gnulib-tool. # Invoked as: gnulib-tool --import -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --aux-dir=scripts alloca-opt allocsa mkdtemp setenv strpbrk strsep vasnprintf vasprintf xsize +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --aux-dir=scripts alloca-opt allocsa mkdtemp setenv strpbrk vasnprintf vasprintf xsize AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies @@ -59,18 +59,6 @@ libgnu_a_SOURCES += setenv.h ## end gnulib module setenv -## begin gnulib module strpbrk - -libgnu_a_SOURCES += strpbrk.h - -## end gnulib module strpbrk - -## begin gnulib module strsep - -libgnu_a_SOURCES += strsep.h - -## end gnulib module strsep - ## begin gnulib module vasnprintf libgnu_a_SOURCES += printf-args.h printf-parse.h vasnprintf.h diff --git a/gl/m4/gnulib.m4 b/gl/m4/gnulib.m4 index 46d5e338b..a17d49dbd 100644 --- a/gl/m4/gnulib.m4 +++ b/gl/m4/gnulib.m4 @@ -8,7 +8,7 @@ # Generated by gnulib-tool. # # Invoked as: gnulib-tool --import -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --aux-dir=scripts alloca-opt allocsa mkdtemp setenv strpbrk strsep vasnprintf vasprintf xsize +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --aux-dir=scripts alloca-opt allocsa mkdtemp setenv strpbrk vasnprintf vasprintf xsize AC_DEFUN([gl_EARLY], [ @@ -21,8 +21,6 @@ AC_DEFUN([gl_INIT], gl_ALLOCSA gt_FUNC_MKDTEMP gt_FUNC_SETENV - gl_FUNC_STRPBRK - gl_FUNC_STRSEP gl_FUNC_VASNPRINTF gl_FUNC_VASPRINTF gl_XSIZE diff --git a/gl/m4/strpbrk.m4 b/gl/m4/strpbrk.m4 deleted file mode 100644 index 68360684e..000000000 --- a/gl/m4/strpbrk.m4 +++ /dev/null @@ -1,16 +0,0 @@ -# strpbrk.m4 serial 2 -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_STRPBRK], -[ - AC_REPLACE_FUNCS(strpbrk) - if test $ac_cv_func_strpbrk = no; then - gl_PREREQ_STRPBRK - fi -]) - -# Prerequisites of lib/strpbrk.c. -AC_DEFUN([gl_PREREQ_STRPBRK], [:]) diff --git a/gl/m4/strsep.m4 b/gl/m4/strsep.m4 deleted file mode 100644 index 40a087b3d..000000000 --- a/gl/m4/strsep.m4 +++ /dev/null @@ -1,17 +0,0 @@ -# strsep.m4 serial 3 -dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_STRSEP], -[ - dnl Persuade glibc <string.h> to declare strsep(). - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_REPLACE_FUNCS(strsep) - gl_PREREQ_STRSEP -]) - -# Prerequisites of lib/strsep.c. -AC_DEFUN([gl_PREREQ_STRSEP], [:]) diff --git a/gl/strpbrk.c b/gl/strpbrk.c deleted file mode 100644 index 9152440b1..000000000 --- a/gl/strpbrk.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1991, 1994, 2000, 2002-2003 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stddef.h> -#include <string.h> - -#undef strpbrk - -/* Find the first occurrence in S of any character in ACCEPT. */ -char * -strpbrk (const char *s, const char *accept) -{ - while (*s != '\0') - { - const char *a = accept; - while (*a != '\0') - if (*a++ == *s) - return (char *) s; - ++s; - } - - return NULL; -} diff --git a/gl/strpbrk.h b/gl/strpbrk.h deleted file mode 100644 index acc8d358b..000000000 --- a/gl/strpbrk.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Searching in a string. - Copyright (C) 2001-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if HAVE_STRPBRK - -/* Get strpbrk() declaration. */ -#include <string.h> - -#else - -/* Find the first occurrence in S of any character in ACCEPT. */ -extern char *strpbrk (const char *s, const char *accept); - -#endif diff --git a/gl/strsep.c b/gl/strsep.c deleted file mode 100644 index 40c2939c8..000000000 --- a/gl/strsep.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 2004 Free Software Foundation, Inc. - - Written by Yoann Vandoorselaere <yoann@prelude-ids.org>. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -/* Specification. */ -#include "strsep.h" - -#include <string.h> - -#include "strpbrk.h" - -char * -strsep (char **stringp, const char *delim) -{ - char *start = *stringp; - char *ptr; - - if (!start) - return NULL; - - if (!*delim) - ptr = start + strlen (start); - else - { - ptr = strpbrk (start, delim); - if (!ptr) - { - *stringp = NULL; - return start; - } - } - - *ptr = '\0'; - *stringp = ptr + 1; - - return start; -} diff --git a/gl/strsep.h b/gl/strsep.h deleted file mode 100644 index ca28a2ffe..000000000 --- a/gl/strsep.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 2004 Free Software Foundation, Inc. - - Written by Yoann Vandoorselaere <yoann@prelude-ids.org>. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef GNULIB_STRSEP_H_ -#define GNULIB_STRSEP_H_ - -#if HAVE_STRSEP - -/* - * Get strsep() declaration. - */ -#include <string.h> - -#else - -/* Searches the next delimiter (char listed in DELIM) starting at *STRINGP. - If one is found, it is overwritten with a NUL, and *STRINGP is advanced - to point to the next char after it. Otherwise, *STRINGP is set to NULL. - If *STRINGP was already NULL, nothing happens. - Returns the old value of *STRINGP. - - This is a variant of strtok() that is multithread-safe and supports - empty fields. - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - Caveat: It doesn't work with multibyte strings unless all of the delimiter - characters are ASCII characters < 0x30. - - See also strtok_r(). */ - -extern char *strsep (char **stringp, const char *delim); - -#endif - -#endif /* GNULIB_STRSEP_H_ */ |