X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fcmpt.c;h=bfc7b2c9ab06275ab043062187f5becd594fba43;hb=d5be8ecca466601bda9b81c28a79077fbda6ccde;hp=b193ae3b794381c126b3c559b9e86c94a6f34fbf;hpb=31d6616c483359af431f4c33c3c5b237cd8d4426;p=wget diff --git a/src/cmpt.c b/src/cmpt.c index b193ae3b..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 @@ -67,8 +66,8 @@ strcasecmp (const char *s1, const char *s2) do { - c1 = tolower (*p1++); - c2 = tolower (*p2++); + c1 = TOLOWER (*p1++); + c2 = TOLOWER (*p2++); if (c1 == '\0') break; } @@ -96,8 +95,8 @@ strncasecmp (const char *s1, const char *s2, size_t n) do { - c1 = tolower (*p1++); - c2 = tolower (*p2++); + c1 = TOLOWER (*p1++); + c2 = TOLOWER (*p2++); if (c1 == '\0' || c1 != c2) return c1 - c2; } while (--n > 0); @@ -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':