svn commit: r302781 - head/gnu/usr.bin/grep

Andrey A. Chernov ache at FreeBSD.org
Wed Jul 13 19:03:01 UTC 2016


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;
     }
 


More information about the svn-src-all mailing list