]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_scan.c
test-nocreate: Don't use run_test and run_prog together.
[nmh] / sbr / fmt_scan.c
index b0beeb23a64889961f3ae6187b1d53e8ca1b7497..a47c170e7c78cdabf5b0d51b1818230d38098033 100644 (file)
@@ -49,24 +49,14 @@ match (char *str, char *sub)
     char *s1, *s2;
 
     while ((c1 = *sub)) {
-       c1 = (isascii((unsigned char) c1) && isalpha((unsigned char) c1) &&
-             isupper((unsigned char) c1)) ? tolower((unsigned char) c1) : c1;
-       while ((c2 = *str++) && c1 != ((isascii((unsigned char) c2) &&
-                                       isalpha((unsigned char) c2) &&
-                                       isupper((unsigned char) c2)) ?
-                                           tolower((unsigned char) c2) : c2))
+       c1 = tolower((unsigned char)c1);
+       while ((c2 = *str++) && c1 != tolower((unsigned char)c2))
            ;
        if (! c2)
            return 0;
        s1 = sub + 1; s2 = str;
-       while ((c1 = *s1++) && ((isascii((unsigned char) c1) &&
-                                isalpha((unsigned char) c1) &&
-                                isupper((unsigned char) c1)) ?
-                                       tolower(c1) : c1) ==
-                       ((isascii((unsigned char) (c2 =*s2++)) &&
-                         isalpha((unsigned char) c2) &&
-                         isupper((unsigned char) c2)) ?
-                               tolower((unsigned char) c2) : c2))
+       while ((c1 = *s1++) &&
+            tolower((unsigned char)c1) == tolower((unsigned char)(c2 = *s2++)))
            ;
        if (! c1)
            return 1;
@@ -1185,5 +1175,5 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
        }
     }
 
-    return ((struct format *)0);
+    return (NULL);
 }