From owner-svn-src-all@FreeBSD.ORG Fri Jun 27 20:39:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B9CCA08; Fri, 27 Jun 2014 20:39:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3142A3B; Fri, 27 Jun 2014 20:39:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RKdjGP093991; Fri, 27 Jun 2014 20:39:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RKdjTI093989; Fri, 27 Jun 2014 20:39:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406272039.s5RKdjTI093989@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Jun 2014 20:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267980 - in stable: 10/sys/libkern 9/sys/libkern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 20:39:46 -0000 Author: jhb Date: Fri Jun 27 20:39:45 2014 New Revision: 267980 URL: http://svnweb.freebsd.org/changeset/base/267980 Log: MFC 267291: Use strcasecmp() instead of strcmp() when checking user-supplied encoding names so that encoding names are treated as case-insensitive. This allows the use of 'utf-8' instead of 'UTF-8' for example and matches the behavior of iconv(1). PR: 167977 Modified: stable/10/sys/libkern/iconv.c stable/10/sys/libkern/iconv_ucs.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/libkern/iconv.c stable/9/sys/libkern/iconv_ucs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/libkern/iconv.c ============================================================================== --- stable/10/sys/libkern/iconv.c Fri Jun 27 20:34:22 2014 (r267979) +++ stable/10/sys/libkern/iconv.c Fri Jun 27 20:39:45 2014 (r267980) @@ -168,8 +168,8 @@ iconv_lookupcs(const char *to, const cha struct iconv_cspair *csp; TAILQ_FOREACH(csp, &iconv_cslist, cp_link) { - if (strcmp(csp->cp_to, to) == 0 && - strcmp(csp->cp_from, from) == 0) { + if (strcasecmp(csp->cp_to, to) == 0 && + strcasecmp(csp->cp_from, from) == 0) { if (cspp) *cspp = csp; return 0; Modified: stable/10/sys/libkern/iconv_ucs.c ============================================================================== --- stable/10/sys/libkern/iconv_ucs.c Fri Jun 27 20:34:22 2014 (r267979) +++ stable/10/sys/libkern/iconv_ucs.c Fri Jun 27 20:39:45 2014 (r267980) @@ -102,9 +102,9 @@ iconv_ucs_open(struct iconv_converter_cl if (cspf) dp->convtype |= KICONV_UCS_COMBINE; for (i = 0; unicode_family[i].name; i++) { - if (strcmp(from, unicode_family[i].name) == 0) + if (strcasecmp(from, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].from_flag; - if (strcmp(to, unicode_family[i].name) == 0) + if (strcasecmp(to, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].to_flag; } if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0)