Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jul 2016 19:02:59 +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: r302781 - head/gnu/usr.bin/grep
Message-ID:  <201607131902.u6DJ2xAu008280@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ache
Date: Wed Jul 13 19:02:59 2016
New Revision: 302781
URL: https://svnweb.freebsd.org/changeset/base/302781

Log:
  After removing collation for [a-z] ranges in r302512, do it here too.
  
  Instead of trying to expand whole range at regcomp() stage as we do,
  GNU regex allocates separate ranges [start,end] set each character
  is checked against, so collation is possible and turned on for ranges here.
  
  When something like that will be implemented or our obsoleted regex code
  will be replaced to something like TRE, and in case we decide to use
  collation in [a-z] ranges, all changes related to r302512 can be backed out,
  but now we need consistency.

Modified:
  head/gnu/usr.bin/grep/dfa.c

Modified: head/gnu/usr.bin/grep/dfa.c
==============================================================================
--- head/gnu/usr.bin/grep/dfa.c	Wed Jul 13 18:51:19 2016	(r302780)
+++ head/gnu/usr.bin/grep/dfa.c	Wed Jul 13 19:02:59 2016	(r302781)
@@ -2547,8 +2547,13 @@ match_mb_charset (struct dfa *d, int s, 
       wcbuf[2] = work_mbc->range_sts[i];
       wcbuf[4] = work_mbc->range_ends[i];
 
+#ifdef __FreeBSD__
+      if (wcscmp(wcbuf, wcbuf+2) >= 0 &&
+	  wcscmp(wcbuf+4, wcbuf) >= 0)
+#else
       if (wcscoll(wcbuf, wcbuf+2) >= 0 &&
 	  wcscoll(wcbuf+4, wcbuf) >= 0)
+#endif
 	goto charset_matched;
     }
 



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