From 1de4cd12f5f78d933ecb9c64a26568776cbc38e6 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 31 Oct 2005 11:09:13 +0000 Subject: [PATCH] Fix for trailing '-' in range expressions. [SVN r31510] --- include/boost/regex/v4/basic_regex_parser.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 6fc25dc2..b5cd2794 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -1220,6 +1220,17 @@ void basic_regex_parser::parse_set_literal(basic_char_setm_traits.syntax_type(*m_position) == regex_constants::syntax_dash) { + if(m_end == ++m_position) + { + fail(regex_constants::error_brack, m_position - m_base); + return; + } + if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_set) + { + // trailing - : + --m_position; + return; + } fail(regex_constants::error_range, m_position - m_base); return; }