From: Michael R Sweet Date: Tue, 8 Nov 2016 14:34:31 +0000 (-0500) Subject: The ippContainsString function now uses case-insensitive comparisons for X-Git-Tag: v2.2.2~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a268a6c985c87c48f59e8ff3e36161bf76ee26eb;p=thirdparty%2Fcups.git The ippContainsString function now uses case-insensitive comparisons for mimeMediaType, name, and text values in conformance with RFC 2911. --- diff --git a/cups/ipp.c b/cups/ipp.c index 1964962ce4..cd7e0cd88c 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -1419,13 +1419,27 @@ ippContainsString( case IPP_TAG_CHARSET : case IPP_TAG_KEYWORD : case IPP_TAG_LANGUAGE : + case IPP_TAG_URI : + case IPP_TAG_URISCHEME : + for (i = attr->num_values, avalue = attr->values; + i > 0; + i --, avalue ++) + { + DEBUG_printf(("1ippContainsString: value[%d]=\"%s\"", + attr->num_values - i, avalue->string.text)); + + if (!strcmp(value, avalue->string.text)) + { + DEBUG_puts("1ippContainsString: Returning 1 (match)"); + return (1); + } + } + case IPP_TAG_MIMETYPE : case IPP_TAG_NAME : case IPP_TAG_NAMELANG : case IPP_TAG_TEXT : case IPP_TAG_TEXTLANG : - case IPP_TAG_URI : - case IPP_TAG_URISCHEME : for (i = attr->num_values, avalue = attr->values; i > 0; i --, avalue ++) @@ -1433,7 +1447,7 @@ ippContainsString( DEBUG_printf(("1ippContainsString: value[%d]=\"%s\"", attr->num_values - i, avalue->string.text)); - if (!strcmp(value, avalue->string.text)) + if (!_cups_strcasecmp(value, avalue->string.text)) { DEBUG_puts("1ippContainsString: Returning 1 (match)"); return (1);