Skip to contentSkip to conversation

LVM2/libdm/regex parse_rx.c

PATCH [email protected] 1 participant 1 message Apr 22, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2010-04-22 20:15:01

Modified files:
libdm/regex : parse_rx.c

Log message:
avoid ORs rightmost

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/parse_rx.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10

libdm/regex/parse_rx.c +1 -7
@@ -421,16 +421,10 @@
 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;