strcasecmp.c 468 B

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