Use strncasecmp() for case-insensitive comparison

Instead of converting everything to upper case and then using strncmp(),
use strncasecmp() which does case-insensitive comparison out of the box.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-12-22 17:25:00 +01:00
parent ef961f4927
commit de73d96188
3 changed files with 22 additions and 39 deletions

View File

@@ -845,14 +845,6 @@ int parse_duration(const char *string, unsigned *duration)
return 1;
}
void str_toupper(char *s)
{
if (!s)
return;
for (; *s; s++)
*s = toupper(*s);
}
void file_close(FILE * f, const char *pos)
{
EXIT_IF((fclose(f)) != 0, _("Error when closing file at %s"), pos);