X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fcmpt.c;h=bfc7b2c9ab06275ab043062187f5becd594fba43;hb=d5be8ecca466601bda9b81c28a79077fbda6ccde;hp=439828ca570639f3b98c77680e17cf24a5ae628f;hpb=6b4a85888e351e8ad6c55770fff98e0eddf22cd2;p=wget diff --git a/src/cmpt.c b/src/cmpt.c index 439828ca..bfc7b2c9 100644 --- a/src/cmpt.c +++ b/src/cmpt.c @@ -1,20 +1,20 @@ /* Replacements for routines missing on some systems. Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. -This file is part of Wget. +This file is part of GNU Wget. -This program is free software; you can redistribute it and/or modify +GNU Wget 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 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +GNU Wget 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 +along with Wget; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include @@ -26,7 +26,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #else # include #endif /* HAVE_STRING_H */ -#include #include #ifdef HAVE_UNISTD_H @@ -206,6 +205,24 @@ ret0: } #endif /* not HAVE_STRSTR */ +#ifndef HAVE_STRPBRK +/* Find the first ocurrence 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 0; +} +#endif /* HAVE_STRPBRK */ + #ifndef HAVE_MKTIME /* From GNU libc 2.0. */ @@ -657,9 +674,9 @@ strptime_internal (buf, format, tm, decided) { /* A white space in the format string matches 0 more or white space in the input string. */ - if (isspace (*fmt)) + if (ISSPACE (*fmt)) { - while (isspace (*rp)) + while (ISSPACE (*rp)) ++rp; ++fmt; continue; @@ -851,7 +868,7 @@ strptime_internal (buf, format, tm, decided) case 'n': case 't': /* Match any white space. */ - while (isspace (*rp)) + while (ISSPACE (*rp)) ++rp; break; case 'p':