| 618 | */ |
| 619 | |
| 620 | int /* O - Result of comparison (-1, 0, or 1) */ |
| 621 | _cups_strcasecmp(const char *s, /* I - First string */ |
| 622 | const char *t) /* I - Second string */ |
| 623 | { |
| 624 | while (*s != '\0' && *t != '\0') |
| 625 | { |
| 626 | if (_cups_tolower(*s) < _cups_tolower(*t)) |
| 627 | return (-1); |
| 628 | else if (_cups_tolower(*s) > _cups_tolower(*t)) |
| 629 | return (1); |
| 630 | |
| 631 | s ++; |
| 632 | t ++; |
| 633 | } |
| 634 | |
| 635 | if (*s == '\0' && *t == '\0') |
| 636 | return (0); |
| 637 | else if (*s != '\0') |
| 638 | return (1); |
| 639 | else |
| 640 | return (-1); |
| 641 | } |
| 642 | |
| 643 | /* |
| 644 | * '_cups_strncasecmp()' - Do a case-insensitive comparison on up to N chars. |