From owner-svn-src-all@freebsd.org Wed Dec 19 23:28:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74975134D725; Wed, 19 Dec 2018 23:28:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A697771C1; Wed, 19 Dec 2018 23:28:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 006951CE17; Wed, 19 Dec 2018 23:28:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJNSuLK071394; Wed, 19 Dec 2018 23:28:56 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNSuCY071393; Wed, 19 Dec 2018 23:28:56 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201812192328.wBJNSuCY071393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 19 Dec 2018 23:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342265 - head/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/lib/libc/regex X-SVN-Commit-Revision: 342265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A697771C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 23:28:57 -0000 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