summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port/regex/utils.h
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2019-09-21 11:49:32 +0300
committerDan McDonald <danmcd@joyent.com>2019-10-22 11:10:03 -0400
commit1603eda21695ca85bfde0e5c75a27d94ac4ce4ff (patch)
tree15ed03687d2d6e662c6eaee0f49666da1373cf18 /usr/src/lib/libc/port/regex/utils.h
parent62e7498000cb79c72fafb7270dbc3beb8a41863d (diff)
downloadillumos-joyent-1603eda21695ca85bfde0e5c75a27d94ac4ce4ff.tar.gz
8908 regcomp: reduce size of bitmap for multibyte locales
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libc/port/regex/utils.h')
-rw-r--r--usr/src/lib/libc/port/regex/utils.h6
1 files changed, 4 insertions, 2 deletions
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 */