Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2016 09:45:08 +0000 (UTC)
From:      "Andrey A. Chernov" <ache@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302832 - head/contrib/libgnuregex
Message-ID:  <201607140945.u6E9j8D4035878@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ache
Date: Thu Jul 14 09:45:07 2016
New Revision: 302832
URL: https://svnweb.freebsd.org/changeset/base/302832

Log:
  Back out non-collating [a-z] ranges.
  Instead of changing the whole course to another POSIX-permitted way
  for consistency and uniformity I decide to completely ignore missing
  regex fucntionality and focus on fixing bugs in what we have now,
  too many small obstacles we have choicing other way, counting ports.
  Corresponding libc changes are backed out in r302824.

Modified:
  head/contrib/libgnuregex/regcomp.c
  head/contrib/libgnuregex/regexec.c

Modified: head/contrib/libgnuregex/regcomp.c
==============================================================================
--- head/contrib/libgnuregex/regcomp.c	Thu Jul 14 09:40:42 2016	(r302831)
+++ head/contrib/libgnuregex/regcomp.c	Thu Jul 14 09:45:07 2016	(r302832)
@@ -2664,11 +2664,7 @@ build_range_exp (bitset_t sbcset, bracke
       return REG_ECOLLATE;
     cmp_buf[0] = start_wc;
     cmp_buf[4] = end_wc;
-#ifdef __FreeBSD__
-    if (wcscmp (cmp_buf, cmp_buf + 4) > 0)
-#else
     if (wcscoll (cmp_buf, cmp_buf + 4) > 0)
-#endif
       return REG_ERANGE;
 
     /* Got valid collation sequence values, add them as a new entry.
@@ -2710,13 +2706,8 @@ build_range_exp (bitset_t sbcset, bracke
     for (wc = 0; wc < SBC_MAX; ++wc)
       {
 	cmp_buf[2] = wc;
-#ifdef __FreeBSD__
-	if (wcscmp (cmp_buf, cmp_buf + 2) <= 0
-	    && wcscmp (cmp_buf + 2, cmp_buf + 4) <= 0)
-#else
 	if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
 	    && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
-#endif
 	  bitset_set (sbcset, wc);
       }
   }

Modified: head/contrib/libgnuregex/regexec.c
==============================================================================
--- head/contrib/libgnuregex/regexec.c	Thu Jul 14 09:40:42 2016	(r302831)
+++ head/contrib/libgnuregex/regexec.c	Thu Jul 14 09:45:07 2016	(r302832)
@@ -3964,13 +3964,8 @@ check_node_accept_bytes (const re_dfa_t 
 	    {
 	      cmp_buf[0] = cset->range_starts[i];
 	      cmp_buf[4] = cset->range_ends[i];
-#ifdef __FreeBSD__
-	      if (wcscmp (cmp_buf, cmp_buf + 2) <= 0
-		  && wcscmp (cmp_buf + 2, cmp_buf + 4) <= 0)
-#else
 	      if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
 		  && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
-#endif
 		{
 		  match_len = char_len;
 		  goto check_node_accept_bytes_match;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607140945.u6E9j8D4035878>