From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29708 invoked by alias); 22 Apr 2010 20:15:02 -0000 Received: (qmail 29659 invoked by uid 9447); 22 Apr 2010 20:15:01 -0000 Date: Thu, 22 Apr 2010 20:15:00 -0000 Message-ID: <20100422201501.29657.qmail@sourceware.org> From: agk@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/libdm/regex parse_rx.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00126.txt.bz2 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;