Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2018 23:28:56 +0000 (UTC)
From:      Yuri Pankov <yuripv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342265 - head/lib/libc/regex
Message-ID:  <201812192328.wBJNSuCY071393@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuripv
Date: Wed Dec 19 23:28:56 2018
New Revision: 342265
URL: https://svnweb.freebsd.org/changeset/base/342265

Log:
  regcomp: revert part of r341838 which turned out to be unrelated
  and caused issues with search in less.
  
  PR:		234066
  Reviewed by:	pfg
  Differential revision:	https://reviews.freebsd.org/D18611

Modified:
  head/lib/libc/regex/regcomp.c

Modified: head/lib/libc/regex/regcomp.c
==============================================================================
--- head/lib/libc/regex/regcomp.c	Wed Dec 19 23:28:29 2018	(r342264)
+++ head/lib/libc/regex/regcomp.c	Wed Dec 19 23:28:56 2018	(r342265)
@@ -1841,29 +1841,21 @@ computejumps(struct parse *p, struct re_guts *g)
 {
 	int ch;
 	int mindex;
-	int cmin, cmax;
 
-	/*
-	 * For UTF-8 we process only the first 128 characters corresponding to
-	 * the POSIX locale.
-	 */
-	cmin = MB_CUR_MAX == 1 ? CHAR_MIN : 0;
-	cmax = MB_CUR_MAX == 1 ? CHAR_MAX : 127;
-
 	/* Avoid making errors worse */
 	if (p->error != 0)
 		return;
 
-	g->charjump = (int *)malloc((cmax - cmin + 1) * sizeof(int));
+	g->charjump = (int *)malloc((NC_MAX + 1) * sizeof(int));
 	if (g->charjump == NULL)	/* Not a fatal error */
 		return;
 	/* Adjust for signed chars, if necessary */
-	g->charjump = &g->charjump[-(cmin)];
+	g->charjump = &g->charjump[-(CHAR_MIN)];
 
 	/* If the character does not exist in the pattern, the jump
 	 * is equal to the number of characters in the pattern.
 	 */
-	for (ch = cmin; ch < cmax + 1; ch++)
+	for (ch = CHAR_MIN; ch < (CHAR_MAX + 1); ch++)
 		g->charjump[ch] = g->mlen;
 
 	/* If the character does exist, compute the jump that would



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