Case insensitive string comparison, doesn't consider two NULL pointers equal though */
| 96 | |
| 97 | /* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ |
| 98 | static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) |
| 99 | { |
| 100 | if ((string1 == NULL) || (string2 == NULL)) |
| 101 | { |
| 102 | return 1; |
| 103 | } |
| 104 | |
| 105 | if (string1 == string2) |
| 106 | { |
| 107 | return 0; |
| 108 | } |
| 109 | |
| 110 | for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) |
| 111 | { |
| 112 | if (*string1 == '\0') |
| 113 | { |
| 114 | return 0; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | return tolower(*string1) - tolower(*string2); |
| 119 | } |
| 120 | |
| 121 | typedef struct internal_hooks |
| 122 | { |