From 2d11c5086c18d7ed55b686e1d59a88b9d51bbb0f Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 14 Jul 2023 08:17:04 +0200 Subject: [PATCH] case insensitive compare in boolean attributes (attr=false, attr=True, attr=FALSE, attr=1) --- src/editprop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editprop.c b/src/editprop.c index b683a381..e311a476 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -82,10 +82,10 @@ int my_strncasecmp(const char *s1, const char *s2, size_t n) /* same as strcmp(), but allow "1" for "true" and "0" for "false" */ int strboolcmp(const char *str, const char *boolean) { - if(!strcmp(boolean, "true")) { - return (strcmp(str, "true") != 0 && strcmp(str,"1") != 0); - } else if(!strcmp(boolean, "false")) { - return (strcmp(str, "false") != 0 && strcmp(str,"0") != 0); + if(!my_strcasecmp(boolean, "true")) { + return (my_strcasecmp(str, "true") != 0 && strcmp(str,"1") != 0); + } else if(!my_strcasecmp(boolean, "false")) { + return (my_strcasecmp(str, "false") != 0 && strcmp(str,"0") != 0); } else { return strcmp(str, boolean); }