From 1603eda21695ca85bfde0e5c75a27d94ac4ce4ff Mon Sep 17 00:00:00 2001 From: Yuri Pankov Date: Sat, 21 Sep 2019 11:49:32 +0300 Subject: 8908 regcomp: reduce size of bitmap for multibyte locales Reviewed by: Andrew Stormont Approved by: Dan McDonald --- usr/src/lib/libc/port/regex/utils.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/src/lib/libc/port/regex/utils.h') diff --git a/usr/src/lib/libc/port/regex/utils.h b/usr/src/lib/libc/port/regex/utils.h index b77dc69433..a1e34f3d75 100644 --- a/usr/src/lib/libc/port/regex/utils.h +++ b/usr/src/lib/libc/port/regex/utils.h @@ -1,5 +1,5 @@ /* - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,9 @@ /* utility definitions */ #define DUPMAX _POSIX2_RE_DUP_MAX /* xxx is this right? */ #define INFINITY (DUPMAX + 1) -#define NC (CHAR_MAX - CHAR_MIN + 1) + +#define NC_MAX (CHAR_MAX - CHAR_MIN + 1) +#define NC ((MB_CUR_MAX) == 1 ? (NC_MAX) : (128)) typedef unsigned char uch; /* switch off assertions (if not already off) if no REDEBUG */ -- cgit v1.2.3