[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] LVM2/libdm/regex parse_rx.c



CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk 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

--- LVM2/libdm/regex/parse_rx.c	2010/04/22 17:42:38	1.9
+++ LVM2/libdm/regex/parse_rx.c	2010/04/22 20:15:00	1.10
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]