strcasecmp.c 432 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 *s, const char *d)
  8. {
  9. for (;;) {
  10. if (*s != *d) {
  11. if (tolower(*s) != tolower(*d))
  12. return *s - *d;
  13. } else if (*s == '\0')
  14. break;
  15. s++;
  16. d++;
  17. }
  18. return 0;
  19. }