From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 01:35:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 071D0106566C; Fri, 11 Nov 2011 01:35:08 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D23F78FC08; Fri, 11 Nov 2011 01:35:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB1Z76f064843; Fri, 11 Nov 2011 01:35:07 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB1Z7Q6064841; Fri, 11 Nov 2011 01:35:07 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201111110135.pAB1Z7Q6064841@svn.freebsd.org> From: Kevin Lo Date: Fri, 11 Nov 2011 01:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227435 - head/lib/libc/regex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 01:35:08 -0000 Author: kevlo Date: Fri Nov 11 01:35:07 2011 New Revision: 227435 URL: http://svn.freebsd.org/changeset/base/227435 Log: Converting int to wint_t leads to broekn comparison of raw char and encoded wint_t. Spotted by: ache Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Fri Nov 11 00:48:41 2011 (r227434) +++ head/lib/libc/regex/regcomp.c Fri Nov 11 01:35:07 2011 (r227435) @@ -81,10 +81,10 @@ extern "C" { #endif /* === regcomp.c === */ -static void p_ere(struct parse *p, wint_t stop); +static void p_ere(struct parse *p, int stop); static void p_ere_exp(struct parse *p); static void p_str(struct parse *p); -static void p_bre(struct parse *p, wint_t end1, wint_t end2); +static void p_bre(struct parse *p, int end1, int end2); static int p_simp_re(struct parse *p, int starordinary); static int p_count(struct parse *p); static void p_bracket(struct parse *p); @@ -285,11 +285,11 @@ regcomp(regex_t * __restrict preg, /* - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(struct parse *p, wint_t stop); + == static void p_ere(struct parse *p, int_t stop); */ static void p_ere(struct parse *p, - wint_t stop) /* character this ERE should end at */ + int stop) /* character this ERE should end at */ { char c; sopno prevback; @@ -493,8 +493,8 @@ p_str(struct parse *p) /* - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(struct parse *p, wint_t end1, \ - == wint_t end2); + == static void p_bre(struct parse *p, int end1, \ + == int end2); * Giving end1 as OUT essentially eliminates the end1/end2 check. * * This implementation is a bit of a kludge, in that a trailing $ is first @@ -503,8 +503,8 @@ p_str(struct parse *p) */ static void p_bre(struct parse *p, - wint_t end1, /* first terminating character */ - wint_t end2) /* second terminating character */ + int end1, /* first terminating character */ + int end2) /* second terminating character */ { sopno start = HERE(); int first = 1; /* first subexpression? */