strcasecmp.c 438 B

123456789101112131415161718192021
  1. /* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
  2. * This file is part of the Linux-8086 C library and is distributed
  3. * under the GNU Library General Public License.
  4. */
  5. #include <string.h>
  6. #include <ctype.h>
  7. int strcasecmp (const char *a, const char *b)
  8. {
  9. register int n;
  10. while (*a == *b || (n = tolower (*a) - tolower (*b)) == 0)
  11. {
  12. if (*a == '\0')
  13. return 0;
  14. a++, b++;
  15. }
  16. return n;
  17. }