Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74898 - in trunk: boost/regex/v4 libs/regex/test/regress
From: john_at_[hidden]
Date: 2011-10-10 12:55:27


Author: johnmaddock
Date: 2011-10-10 12:55:27 EDT (Mon, 10 Oct 2011)
New Revision: 74898
URL: http://svn.boost.org/trac/boost/changeset/74898

Log:
Fix case change bug.
Fixes #698.
Text files modified:
   trunk/boost/regex/v4/basic_regex_creator.hpp | 2 +-
   trunk/libs/regex/test/regress/test_perl_ex.cpp | 4 ++++
   2 files changed, 5 insertions(+), 1 deletions(-)

Modified: trunk/boost/regex/v4/basic_regex_creator.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex_creator.hpp (original)
+++ trunk/boost/regex/v4/basic_regex_creator.hpp 2011-10-10 12:55:27 EDT (Mon, 10 Oct 2011)
@@ -1226,7 +1226,7 @@
                for(unsigned int i = 0; i < (1u << CHAR_BIT); ++i)
                {
                   charT c = static_cast<charT>(i);
- if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<mask_type>*>(state), *m_pdata, m_icase))
+ if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<mask_type>*>(state), *m_pdata, l_icase))
                      l_map[i] |= mask;
                }
             }

Modified: trunk/libs/regex/test/regress/test_perl_ex.cpp
==============================================================================
--- trunk/libs/regex/test/regress/test_perl_ex.cpp (original)
+++ trunk/libs/regex/test/regress/test_perl_ex.cpp 2011-10-10 12:55:27 EDT (Mon, 10 Oct 2011)
@@ -216,6 +216,10 @@
    TEST_REGEX_SEARCH("(a(?i)b)c", perl, "ABc", match_default, make_array(-2, -2));
    TEST_REGEX_SEARCH("(a(?i)b)c", perl, "ABC", match_default, make_array(-2, -2));
    TEST_REGEX_SEARCH("(a(?i)b)c", perl, "AbC", match_default, make_array(-2, -2));
+ TEST_REGEX_SEARCH("(?i)[dh]og", perl, "hog", match_default, make_array(0, 3, -2, -2));
+ TEST_REGEX_SEARCH("(?i)[dh]og", perl, "dog", match_default, make_array(0, 3, -2, -2));
+ TEST_REGEX_SEARCH("(?i)[dh]og", perl, "Hog", match_default, make_array(0, 3, -2, -2));
+ TEST_REGEX_SEARCH("(?i)[dh]og", perl, "Dog", match_default, make_array(0, 3, -2, -2));
    
    TEST_REGEX_SEARCH("(a(?i)B)c", perl, "abc", match_default, make_array(0, 3, 0, 2, -2, -2));
    TEST_REGEX_SEARCH("(a(?i)B)c", perl, "aBc", match_default, make_array(0, 3, 0, 2, -2, -2));


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk