]> sourceware.org Git - lvm2.git/commitdiff
avoid ORs rightmost
authorAlasdair Kergon <agk@redhat.com>
Thu, 22 Apr 2010 20:15:00 +0000 (20:15 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 22 Apr 2010 20:15:00 +0000 (20:15 +0000)
libdm/regex/parse_rx.c

index d0894fe52ae8a5f6f26e4fb7498de4686e8398e3..fe38c7a81a1894f9f4305cd1994048140b11a547 100644 (file)
@@ -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;
This page took 0.042337 seconds and 5 git commands to generate.