X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffmt_scan.c;h=2c16dfef9324f1566838dcf164c86fd600433b7f;hp=4f9bce0ed84d6c182404c4f9e44e0a17b33be127;hb=39cd310f18074231e3400e53f7e5234a8615a87e;hpb=5b792c4424571f05bc2008e3109797d18d7d00d1 diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 4f9bce0..2c16dfe 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -57,32 +57,17 @@ match(char *str, char *sub) int c1, c2; char *s1, *s2; -#ifdef LOCALE while ((c1 = *sub)) { - c1 = (isalpha(c1) && isupper(c1)) ? tolower(c1) : c1; - while ((c2 = *str++) && c1 != ((isalpha(c2) && isupper(c2)) ? tolower(c2) : c2)) + while ((c2 = *str++) && tolower(c1) != tolower(c2)) ; if (! c2) return 0; s1 = sub + 1; s2 = str; - while ((c1 = *s1++) && ((isalpha(c1) && isupper(c1)) ? tolower(c1) : c1) == ((isalpha(c2 =*s2++) && isupper(c2)) ? tolower(c2) : c2)) + while ((c1 = *s1++) && tolower(c1) == tolower(*s2++)) ; if (! c1) return 1; } -#else - while ((c1 = *sub)) { - while ((c2 = *str++) && (c1 | 040) != (c2 | 040)) - ; - if (! c2) - return 0; - s1 = sub + 1; s2 = str; - while ((c1 = *s1++) && (c1 | 040) == (*s2++ | 040)) - ; - if (! c1) - return 1; - } -#endif return 1; } @@ -217,12 +202,7 @@ cpstripped(char **start, char *end, char *str) return; /* skip any initial control characters or spaces */ - while ((c = (unsigned char) *s) && -#ifdef LOCALE - (iscntrl(c) || isspace(c))) -#else - (c <= 32)) -#endif + while ((c = (unsigned char) *s) && (iscntrl(c) || isspace(c))) s++; /* compact repeated control characters and spaces into a single space */ @@ -231,11 +211,7 @@ cpstripped(char **start, char *end, char *str) *(*start)++ = c; else { while ((c = (unsigned char) *s) && -#ifdef LOCALE - (iscntrl(c) || isspace(c))) -#else - (c <= 32)) -#endif + (iscntrl(c) || isspace(c))) s++; *(*start)++ = ' '; }