src/lib/scan.c
int
fstrsch(const char *a, const char *b)   /* folded case search */
{
   const char *s1,*s2;
   char c1, c2;

   s1=a;
   s2=b;
   while (*s1) {                      /* do it the fast way */
      if ((*s1++ | 0x20) != (*s2++ | 0x20))
         return 0;                    /* failed */
   }
   while (*a) {                       /* do it over the correct slow way */
      if (B_ISUPPER(c1 = *a)) {
         c1 = tolower((int)c1);
      }
      if (B_ISUPPER(c2 = *b)) {
         c2 = tolower((int)c2);
      }
      if (c1 != c2) {
         return 0;
      }
      a++;
      b++;
   }
   return 1;
}
/* folded search for string - case insensitive */
folded search for string - case insensitive
folded search for string - case insensitive
int
fstrsch(const char *a, const char *b)   
{
   const char *s1,*s2;
   char c1, c2;
   s1=a;
   s2=b;
   while (*s1) {                      
      if ((*s1++ | 0x20) != (*s2++ | 0x20))
         return 0;                    
   }
   while (*a) {                       
      if (B_ISUPPER(c1 = *a)) {
         c1 = tolower((int)c1);
      }
      if (B_ISUPPER(c2 = *b)) {
         c2 = tolower((int)c2);
      }
      if (c1 != c2) {
         return 0;
      }
      a++;
      b++;
   }
   return 1;
}
int fstrsch ( const char * a , const char * b ) { const char * s1 , * s2 ; char c1 , c2 ; s1 = a ; s2 = b ; while ( * s1 ) { if ( ( * s1 ++ | 0x20 ) != ( * s2 ++ | 0x20 ) ) return 0 ; } while ( * a ) { if ( B_ISUPPER ( c1 = * a ) ) { c1 = tolower ( ( int ) c1 ) ; } if ( B_ISUPPER ( c2 = * b ) ) { c2 = tolower ( ( int ) c2 ) ; } if ( c1 != c2 ) { return 0 ; } a ++ ; b ++ ; } return 1 ; }
folded search for string - case insensitive
folded search for string - case insensitive
/* folded case search */ /* do it the fast way */ /* failed */ /* do it over the correct slow way */