summaryrefslogtreecommitdiff
path: root/libdm/regex
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2010-04-22 20:15:00 +0000
committerAlasdair Kergon <agk@redhat.com>2010-04-22 20:15:00 +0000
commit92f67fed0a899f5a1e48cd9f84b22543b74563f9 (patch)
tree32c5b9fadbcdbe5d0efa1b58ae7a634b2fdd31e1 /libdm/regex
parentd9c67df256def0acc38526b22e2e123ebf6449b9 (diff)
downloadlvm2-92f67fed0a899f5a1e48cd9f84b22543b74563f9.tar.gz
avoid ORs rightmost
Diffstat (limited to 'libdm/regex')
-rw-r--r--libdm/regex/parse_rx.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/libdm/regex/parse_rx.c b/libdm/regex/parse_rx.c
index d0894fe52..fe38c7a81 100644
--- a/libdm/regex/parse_rx.c
+++ b/libdm/regex/parse_rx.c
@@ -421,16 +421,10 @@ static struct rx_node *_or_term(struct parse_sp *ps)
static unsigned _depth(struct rx_node *r, unsigned leftmost)
{
int count = 1;
- int or_count = 0;
- while (r->type != CHARSET && LEFT(r)) {
+ while (r->type != CHARSET && LEFT(r) && (leftmost || r->type != OR)) {
count++;
r = LEFT(r);
- /* Stop if we pass another OR */
- if (or_count)
- break;
- if (r->type == OR)
- or_count++;
}
return count;