X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Futils.c;fp=src%2Futils.c;h=b720f7d79fabe462a90b090dab53651c5b3fade2;hp=641793e9e8c90c57ca808cbc7abae54beed968ce;hb=462e643a7e31676eceda23e634241f7b4d2cd7bb;hpb=3073a77ed89e7d9527d110a028d134bfd1f9cb40 diff --git a/src/utils.c b/src/utils.c index 641793e9..b720f7d7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -28,7 +28,7 @@ Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL used as well as that of the covered work. */ -#include +#include "wget.h" #include #include @@ -43,6 +43,9 @@ as that of the covered work. */ #ifdef HAVE_MMAP # include #endif +#ifdef HAVE_PROCESS_H +# include /* getpid() */ +#endif #ifdef HAVE_UTIME_H # include #endif @@ -78,7 +81,6 @@ as that of the covered work. */ # define USE_SIGNAL_TIMEOUT #endif -#include "wget.h" #include "utils.h" #include "hash.h" @@ -94,7 +96,7 @@ xstrdup_lower (const char *s) char *copy = xstrdup (s); char *p = copy; for (; *p; p++) - *p = TOLOWER (*p); + *p = c_tolower (*p); return copy; } @@ -133,7 +135,7 @@ sepstring (const char *s) res[++i] = NULL; ++s; /* Skip the blanks following the ','. */ - while (ISSPACE (*s)) + while (c_isspace (*s)) ++s; p = s; } @@ -634,10 +636,10 @@ fnmatch_nocase (const char *pattern, const char *string, int flags) char *strcopy = (char *) alloca (strlen (string) + 1); char *p; for (p = patcopy; *pattern; pattern++, p++) - *p = TOLOWER (*pattern); + *p = c_tolower (*pattern); *p = '\0'; for (p = strcopy; *string; string++, p++) - *p = TOLOWER (*string); + *p = c_tolower (*string); *p = '\0'; return fnmatch (patcopy, strcopy, flags); #endif @@ -679,7 +681,7 @@ subdir_p (const char *d1, const char *d2) for (; *d1 && *d2 && (*d1 == *d2); ++d1, ++d2) ; else - for (; *d1 && *d2 && (TOLOWER (*d1) == TOLOWER (*d2)); ++d1, ++d2) + for (; *d1 && *d2 && (c_tolower (*d1) == c_tolower (*d2)); ++d1, ++d2) ; return *d1 == '\0' && (*d2 == '\0' || *d2 == '/'); @@ -764,7 +766,7 @@ match_tail (const char *string, const char *tail, bool fold_case) else { for (i = strlen (string), j = strlen (tail); i >= 0 && j >= 0; i--, j--) - if (TOLOWER (string[i]) != TOLOWER (tail[j])) + if (c_tolower (string[i]) != c_tolower (tail[j])) break; } @@ -1938,7 +1940,7 @@ base64_encode (const void *data, int length, char *dest) when end of string is reached. */ #define NEXT_CHAR(c, p) do { \ c = (unsigned char) *p++; \ -} while (ISSPACE (c)) +} while (c_isspace (c)) #define IS_ASCII(c) (((c) & 0x80) == 0)