]> sourceware.org Git - lvm2.git/commitdiff
don't optimise anything with TARGET_TRANS to avoid intefering with the matcher's...
authorAlasdair Kergon <agk@redhat.com>
Thu, 22 Apr 2010 23:09:18 +0000 (23:09 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 22 Apr 2010 23:09:18 +0000 (23:09 +0000)
libdm/regex/matcher.c
libdm/regex/parse_rx.c
libdm/regex/parse_rx.h

index fe3979d41d40119e38a6304ca10f92bb861009e6..350a35303a0b6345550f9ce4fe65c2be99278c4c 100644 (file)
@@ -37,8 +37,6 @@ struct dm_regex {             /* Instance variables for the lexer */
        struct dm_pool *scratch, *mem;
 };
 
-#define TARGET_TRANS '\0'
-
 static int _count_nodes(struct rx_node *rx)
 {
        int r = 1;
index fe38c7a81a1894f9f4305cd1994048140b11a547..20f8c30e23821e9f2df74f8cfdeb7e0f551f004c 100644 (file)
@@ -452,7 +452,12 @@ static int _nodes_equal(struct rx_node *l, struct rx_node *r)
                return _nodes_equal(l->left, r->left);
 
        case CHARSET:
-               return dm_bitset_equal(l->charset, r->charset);
+               /*
+                * Never change anything containing TARGET_TRANS
+                * used by matcher as boundary marker between concatenated
+                * expressions.
+                */
+               return (!dm_bit(l->charset, TARGET_TRANS) && dm_bitset_equal(l->charset, r->charset));
        }
 
        /* NOTREACHED */
index 1c2393fc1a18a6b62acf9a0e0cd2d5fe404ed7ed..4a5d8b94d61188f16251bb06557798e9d99cc114 100644 (file)
@@ -33,6 +33,8 @@ enum {
 #define HAT_CHAR 0x2
 #define DOLLAR_CHAR 0x3
 
+#define TARGET_TRANS '\0'
+
 struct rx_node {
        int type;
        dm_bitset_t charset;
This page took 0.045119 seconds and 5 git commands to generate.