summaryrefslogtreecommitdiff
path: root/lib/regex.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-04-13 22:16:58 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-04-13 22:16:58 +0000
commit3125c35bc714e4edf4649c49d367f8089ce9a0ad (patch)
treecfe8ec3783638cf5e5ceb717f71051966ddbf242 /lib/regex.h
parent372285b20718e6da7dcb9f6069813459de89f108 (diff)
downloadcoreutils-3125c35bc714e4edf4649c49d367f8089ce9a0ad.tar.xz
(RE_DUP_MAX): Update comment to match current implementation.
Diffstat (limited to 'lib/regex.h')
-rw-r--r--lib/regex.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/regex.h b/lib/regex.h
index b1ae24906..51857e559 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -322,7 +322,14 @@ extern reg_syntax_t re_syntax_options;
# ifdef RE_DUP_MAX
# undef RE_DUP_MAX
# endif
-/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
+
+/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored
+ the counter as a 2-byte signed integer. This is no longer true, so
+ RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to
+ ((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined.
+ However, there would be a huge performance problem if someone
+ actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains
+ its historical value. */
# define RE_DUP_MAX (0x7fff)
#endif /* defined __USE_GNU_REGEX */