/* 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 <config.h>
#else
# include <strings.h>
#endif /* HAVE_STRING_H */
-#include <ctype.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
do
{
- c1 = tolower (*p1++);
- c2 = tolower (*p2++);
+ c1 = TOLOWER (*p1++);
+ c2 = TOLOWER (*p2++);
if (c1 == '\0')
break;
}
do
{
- c1 = tolower (*p1++);
- c2 = tolower (*p2++);
+ c1 = TOLOWER (*p1++);
+ c2 = TOLOWER (*p2++);
if (c1 == '\0' || c1 != c2)
return c1 - c2;
} while (--n > 0);
}
#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. */
{
/* 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;
case 'n':
case 't':
/* Match any white space. */
- while (isspace (*rp))
+ while (ISSPACE (*rp))
++rp;
break;
case 'p':