Changed all toupper, tolower, isupper, islower and isalpha to internal defined function. Case insensitive regexp should work on Win9x now.
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
@@ -50,6 +49,8 @@
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#include <gdefs.h>
|
||||
#include <gctype.h>
|
||||
#include <fptools.h>
|
||||
|
||||
#if 0
|
||||
@@ -147,12 +148,12 @@ _FP_stricmp (char *str1, char *str2)
|
||||
return -1;
|
||||
|
||||
while (*str1) {
|
||||
if (tolower(*str1) != tolower(*str2))
|
||||
if (g_tolower(*str1) != g_tolower(*str2))
|
||||
break;
|
||||
str1++;
|
||||
str2++;
|
||||
}
|
||||
return (tolower (*str1) - tolower (*str2));
|
||||
return (g_tolower (*str1) - g_tolower (*str2));
|
||||
}
|
||||
|
||||
int TOOLEXPORT
|
||||
@@ -162,13 +163,13 @@ _FP_strnicmp (char *str1, char *str2, int count)
|
||||
return -1;
|
||||
|
||||
while (*str1 && count) {
|
||||
if (tolower(*str1) != tolower(*str2))
|
||||
if (g_tolower(*str1) != g_tolower(*str2))
|
||||
break;
|
||||
str1++;
|
||||
str2++;
|
||||
count--;
|
||||
}
|
||||
return count ? (tolower (*str1) - tolower (*str2)) : 0;
|
||||
return count ? (g_tolower (*str1) - g_tolower (*str2)) : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -269,7 +270,7 @@ _FP_stristr (char *str1, char *str2)
|
||||
|
||||
while (*(ptr1=str1)) {
|
||||
for (ptr2=str2;
|
||||
*ptr1 && *ptr2 && tolower(*ptr1)==tolower(*ptr2);
|
||||
*ptr1 && *ptr2 && g_tolower(*ptr1)==g_tolower(*ptr2);
|
||||
ptr1++, ptr2++)
|
||||
/* empty loop */ ;
|
||||
|
||||
@@ -332,7 +333,7 @@ _FP_stoupper (char *input)
|
||||
return NULL;
|
||||
|
||||
while (*iter) {
|
||||
*iter = toupper (*iter);
|
||||
*iter = g_toupper (*iter);
|
||||
iter++;
|
||||
}
|
||||
return input;
|
||||
@@ -347,7 +348,7 @@ _FP_stolower (char *input)
|
||||
return NULL;
|
||||
|
||||
while (*iter) {
|
||||
*iter = tolower (*iter);
|
||||
*iter = g_tolower (*iter);
|
||||
iter++;
|
||||
}
|
||||
return input;
|
||||
|
@@ -32,7 +32,6 @@
|
||||
**/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
@@ -48,6 +47,8 @@
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#include <gdefs.h>
|
||||
#include <gctype.h>
|
||||
#include <uudeview.h>
|
||||
#include <uuint.h>
|
||||
#include <fptools.h>
|
||||
@@ -165,7 +166,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
|
||||
count = length = alflag = 0;
|
||||
while (iter[count] &&
|
||||
(isalnum (iter[count]) || strchr (uufnchars, iter[count])!=NULL)) {
|
||||
if (isalpha (iter[count]))
|
||||
if (g_isalpha(iter[count]))
|
||||
alflag++;
|
||||
count++;
|
||||
}
|
||||
@@ -224,14 +225,14 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
|
||||
|
||||
if (_FP_strnicmp (ptr, "ftp", 3) == 0) {
|
||||
/* hey, that's an ftp address */
|
||||
while (isalpha (*ptr) || isdigit (*ptr) || *ptr == '.')
|
||||
while (g_isalpha(*ptr) || isdigit (*ptr) || *ptr == '.')
|
||||
ptr++;
|
||||
continue;
|
||||
}
|
||||
|
||||
while ((isalnum(*iter)||strchr(uufnchars, *iter)!=NULL||
|
||||
*iter=='/') && *iter && iter != ptonum && *iter != '.') {
|
||||
if (isalpha (*iter))
|
||||
if (g_isalpha(*iter))
|
||||
alflag = 1;
|
||||
|
||||
count++; iter++;
|
||||
@@ -253,7 +254,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
|
||||
if (_FP_strnicmp (iter, "edu", 3) == 0 ||
|
||||
_FP_strnicmp (iter, "gov", 3) == 0) {
|
||||
/* hey, that's an ftp address */
|
||||
while (isalpha (*iter) || isdigit (*iter) || *iter == '.')
|
||||
while (g_isalpha(*iter) || isdigit (*iter) || *iter == '.')
|
||||
iter++;
|
||||
ptr = iter;
|
||||
length = 0;
|
||||
@@ -310,7 +311,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
|
||||
if (length == 0) { /* No filename found, use subject line for ident */
|
||||
ptr = subject;
|
||||
|
||||
while (*ptr && !isalpha (*ptr))
|
||||
while (*ptr && !g_isalpha(*ptr))
|
||||
ptr++;
|
||||
|
||||
while ((isalnum(ptr[length])||strchr(uufnchars,ptr[length])!=NULL||
|
||||
@@ -541,7 +542,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
|
||||
if (isdigit(*(iter-1))) {
|
||||
while (iter>subject && isdigit (*(iter-1)))
|
||||
iter--;
|
||||
if (!isdigit (*iter) && !isalpha (*iter) && *iter != '.')
|
||||
if (!isdigit (*iter) && !g_isalpha(*iter) && *iter != '.')
|
||||
iter++;
|
||||
ptr = iter;
|
||||
|
||||
@@ -595,7 +596,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
|
||||
ptr = subject;
|
||||
|
||||
while (count > 0) {
|
||||
if (!isdigit(ptr[count])||isalpha(ptr[count+1])||ptr[count+1] == '.') {
|
||||
if (!isdigit(ptr[count])||g_isalpha(ptr[count+1])||ptr[count+1] == '.') {
|
||||
count--;
|
||||
continue;
|
||||
}
|
||||
@@ -604,7 +605,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
|
||||
while (count >= 0 && isdigit (ptr[count])) {
|
||||
count--; length++;
|
||||
}
|
||||
if (count>=0 && ((isalpha (ptr[count]) &&
|
||||
if (count>=0 && ((g_isalpha(ptr[count]) &&
|
||||
(ptr[count] != 's' || ptr[count+1] != 't') &&
|
||||
(ptr[count] != 'n' || ptr[count+1] != 'd')) ||
|
||||
ptr[count] == '/' || ptr[count] == '.' ||
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
@@ -52,6 +51,8 @@
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include <gdefs.h>
|
||||
#include <gctype.h>
|
||||
#include <crc32.h>
|
||||
#include <uudeview.h>
|
||||
#include <uuint.h>
|
||||
@@ -465,7 +466,7 @@ UUValidData (char *ptr, int encoding, int *bhflag)
|
||||
goto _t_XX; /* bad length */
|
||||
}
|
||||
|
||||
if (len != j || islower (*ptr)) {
|
||||
if (len != j || g_islower (*ptr)) {
|
||||
/*
|
||||
* if we are not in a 'uuencoded' state, don't allow the line to have
|
||||
* space characters at all. if we know we _are_ decoding uuencoded
|
||||
@@ -788,8 +789,8 @@ UUDecodeQP (FILE *datain, FILE *dataout, int *state,
|
||||
p1 = ++p2;
|
||||
|
||||
if (isxdigit (*p2) && isxdigit (*(p2+1))) {
|
||||
val = ((isdigit(*p2)) ? (*p2-'0') : (tolower(*p2)-'a'+10)) << 4;
|
||||
val |= ((isdigit(*(p2+1)))?(*(p2+1)-'0') : (tolower(*(p2+1))-'a'+10));
|
||||
val = ((isdigit(*p2)) ? (*p2-'0') : (g_tolower(*p2)-'a'+10)) << 4;
|
||||
val |= ((isdigit(*(p2+1)))?(*(p2+1)-'0') : (g_tolower(*(p2+1))-'a'+10));
|
||||
|
||||
fputc (val, dataout);
|
||||
p2 += 2;
|
||||
|
Reference in New Issue
Block a user