From 792992997911171aa802896d5e91a837bb545308 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 22 Apr 2010 20:15:00 +0000 Subject: [PATCH] avoid ORs rightmost --- libdm/regex/parse_rx.c | 8 +------- 1 file changed, 1 insertion(+), 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; -- 2.43.5