From b4e5271bb511fafb0a31259188c37df48fb54b2b Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 24 Sep 2008 08:52:27 +0200 Subject: [PATCH] Use str.h functions for case insensitive comparisons. Signed-off-by: Florent Bruneau --- postlicyd/match.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/postlicyd/match.c b/postlicyd/match.c index 91edd17..5dbf3d4 100644 --- a/postlicyd/match.c +++ b/postlicyd/match.c @@ -212,7 +212,7 @@ static inline bool match_condition(const match_condition_t *cond, const query_t return !!((strcmp(field, cond->value) == 0) ^ (cond->condition == MATCH_DIFFER)); } else { - return !!((strcasecmp(field, cond->value) == 0) + return !!((ascii_strcasecmp(field, cond->value) == 0) ^ (cond->condition == MATCH_DIFFER)); } break; @@ -224,8 +224,7 @@ static inline bool match_condition(const match_condition_t *cond, const query_t if (cond->case_sensitive) { return strstr(field, cond->value); } else { - /* XXX: GNU Sources */ - return strcasestr(field, cond->value); + return m_stristrn(field, cond->value, cond->value_len); } break; @@ -236,8 +235,7 @@ static inline bool match_condition(const match_condition_t *cond, const query_t if (cond->case_sensitive) { return strstr(cond->value, field); } else { - /* XXX: GNU Sources */ - return strcasestr(cond->value, field); + return m_stristr(cond->value, field); } break; -- 2.20.1