Do a case-insensitive, whitespace-ignoring string equality check. */
| 280 | |
| 281 | /* Do a case-insensitive, whitespace-ignoring string equality check. */ |
| 282 | static int strwiEQ(char *psz1, char *psz2) |
| 283 | { |
| 284 | /* If one or both strings are NULL, we return equality right away. */ |
| 285 | if (psz1 == psz2) |
| 286 | return 1; |
| 287 | if (psz1 == NULL || psz2 == NULL) |
| 288 | return 0; |
| 289 | |
| 290 | /* sync the strings on first non-whitespace */ |
| 291 | while (1) { |
| 292 | while (isSpace(psz1)) |
| 293 | psz1++; |
| 294 | while (isSpace(psz2)) |
| 295 | psz2++; |
| 296 | if (*psz1 == '\0' || *psz2 == '\0') |
| 297 | break; |
| 298 | if (toUpper(psz1) != toUpper(psz2)) |
| 299 | break; |
| 300 | psz1++; |
| 301 | psz2++; |
| 302 | } |
| 303 | return *psz1 == *psz2; |
| 304 | } |
| 305 | |
| 306 | /* Find a section by name. Otherwise works like get_section. */ |
| 307 | static int getsectionbyname(char *name) |
no test coverage detected