From 7def56f1e41e2f6fa74449d3bca5193594ab2647 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 9 Aug 2010 10:29:42 +0000 Subject: [PATCH] [REGEX] Parse regexes that contain chars with value > 0x80 This is a long standing issue. Fixed by casting a char value to unsigned char before using it as an index into a bitset. --- libdm/regex/parse_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdm/regex/parse_rx.c b/libdm/regex/parse_rx.c index 56260f54e..9f3e1647b 100644 --- a/libdm/regex/parse_rx.c +++ b/libdm/regex/parse_rx.c @@ -271,7 +271,7 @@ static int _rx_get_token(struct parse_sp *ps) ps->type = 0; ps->cursor = ptr + 1; dm_bit_clear_all(ps->charset); - dm_bit_set(ps->charset, (int) *ptr); + dm_bit_set(ps->charset, (int) (unsigned char) *ptr); break; }