From owner-svn-src-stable-9@FreeBSD.ORG Fri Aug 2 17:13:29 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D15EF86C; Fri, 2 Aug 2013 17:13:29 +0000 (UTC) (envelope-from ache@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BEB262178; Fri, 2 Aug 2013 17:13:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r72HDTtF006560; Fri, 2 Aug 2013 17:13:29 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r72HDT0j006559; Fri, 2 Aug 2013 17:13:29 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201308021713.r72HDT0j006559@svn.freebsd.org> From: "Andrey A. Chernov" Date: Fri, 2 Aug 2013 17:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253888 - stable/9/usr.bin/grep/regex X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 17:13:29 -0000 Author: ache Date: Fri Aug 2 17:13:29 2013 New Revision: 253888 URL: http://svnweb.freebsd.org/changeset/base/253888 Log: MFC r253810 grep -i does not work for simple patterns and single byte locales, like LANG=ru_RU.KOI8-R grep -i Fix it. Approved by: re (delphij,kib) Modified: stable/9/usr.bin/grep/regex/tre-fastmatch.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- stable/9/usr.bin/grep/regex/tre-fastmatch.c Fri Aug 2 14:44:11 2013 (r253887) +++ stable/9/usr.bin/grep/regex/tre-fastmatch.c Fri Aug 2 17:13:29 2013 (r253888) @@ -395,7 +395,7 @@ static int fastcmp(const fastmatch_t *fg if (p == NULL) \ return REG_ESPACE; \ for (unsigned int i = 0; i < plen; i++) \ - p[i] = tolower(pat[i]); \ + p[i] = tolower((unsigned char)pat[i]); \ _CALC_BMGS(arr, p, plen); \ xfree(p); \ } \ @@ -1030,7 +1030,7 @@ fastcmp(const fastmatch_t *fg, const voi continue; /* Compare */ - if (fg->icase ? (tolower(pat_byte[i]) == tolower(str_byte[i])) + if (fg->icase ? (tolower((unsigned char)pat_byte[i]) == tolower((unsigned char)str_byte[i])) : (pat_byte[i] == str_byte[i])) continue; }