summaryrefslogtreecommitdiff
path: root/posix/regcomp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-03-03 13:34:35 +0000
committerJakub Jelinek <jakub@redhat.com>2005-03-03 13:34:35 +0000
commitd0fec8d06cc2234c8114b51f630466eff9d5f841 (patch)
tree223a7fdae69137bd5670e59249442bc6a2db1ad1 /posix/regcomp.c
parent00e4559b612f179492ff3721f86c92498894432f (diff)
Updated to fedora-glibc-20050302T1820
Diffstat (limited to 'posix/regcomp.c')
-rw-r--r--posix/regcomp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 1a5f7952c3..a7112cffdd 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -1321,6 +1321,11 @@ lower_subexp (err, preg, node)
bin_tree_t *op, *cls, *tree1, *tree;
if (preg->no_sub
+ /* We do not optimize empty subexpressions, because otherwise we may
+ have bad CONCAT nodes with NULL children. This is obviously not
+ very common, so we do not lose much. An example that triggers
+ this case is the sed "script" /\(\)/x. */
+ && node->left != NULL
&& (node->token.opr.idx >= 8 * sizeof (dfa->used_bkref_map)
|| !(dfa->used_bkref_map & (1 << node->token.opr.idx))))
return node->left;