forked from boostorg/regex
Compare commits
9 Commits
pr/default
...
issue227
Author | SHA1 | Date | |
---|---|---|---|
3a50c6828c | |||
be12f75b22 | |||
39ee6e36b0 | |||
bd0e76f42f | |||
bb9f2b1984 | |||
49c4e8cb8f | |||
e61e5e111e | |||
cff442b3e7 | |||
65726f3d2f |
@ -44,7 +44,7 @@ path-constant HERE : . ;
|
||||
test-suite regex-examples :
|
||||
|
||||
[ regex-test-run timer/regex_timer.cpp /boost/smart_ptr//boost_smart_ptr : $(HERE)/timer/input_script.txt ]
|
||||
[ regex-test-run grep/grep.cpp /boost/program_options//boost_program_options/<link>static : -n -b $(HERE)/../include/boost/regex.hpp : test_grep ]
|
||||
[ regex-test-run grep/grep.cpp /boost/program_options//boost_program_options/<link>static : -n -b -E include $(HERE)/../include/boost/regex.hpp : test_grep ]
|
||||
[ regex-test-run snippets/credit_card_example.cpp ]
|
||||
[ regex-test-run snippets/mfc_example.cpp ]
|
||||
[ regex-test-run snippets/icu_example.cpp ]
|
||||
|
@ -1204,7 +1204,10 @@ bool perl_matcher<BidiIterator, Allocator, traits>::skip_until_paren(int index,
|
||||
else if(pstate->type == syntax_element_startmark)
|
||||
{
|
||||
int idx = static_cast<const re_brace*>(pstate)->index;
|
||||
pstate = pstate->next.p;
|
||||
if(idx > 0)
|
||||
match_startmark();
|
||||
else
|
||||
pstate = pstate->next.p;
|
||||
skip_until_paren(idx, false);
|
||||
continue;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
* DESCRIPTION: Implements the wide character POSIX API wrappers.
|
||||
*/
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS // for std::wcscpy
|
||||
#define BOOST_REGEX_SOURCE
|
||||
|
||||
#include <boost/regex/config.hpp>
|
||||
@ -169,11 +170,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
||||
{
|
||||
result = std::wcslen(wnames[code]) + 1;
|
||||
if(buf_size >= result)
|
||||
#if (BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)) || (defined(BOOST_CLANG) && defined(_MSC_VER))
|
||||
::wcscpy_s(buf, buf_size, wnames[code]);
|
||||
#else
|
||||
std::wcscpy(buf, wnames[code]);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
@ -193,11 +190,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
||||
(boost::core::swprintf)(localbuf, 5, L"%d", i);
|
||||
#endif
|
||||
if(std::wcslen(localbuf) < buf_size)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||
::wcscpy_s(buf, buf_size, localbuf);
|
||||
#else
|
||||
std::wcscpy(buf, localbuf);
|
||||
#endif
|
||||
return std::wcslen(localbuf) + 1;
|
||||
}
|
||||
}
|
||||
@ -207,11 +200,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
||||
(boost::core::swprintf)(localbuf, 5, L"%d", 0);
|
||||
#endif
|
||||
if(std::wcslen(localbuf) < buf_size)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||
::wcscpy_s(buf, buf_size, localbuf);
|
||||
#else
|
||||
std::wcscpy(buf, localbuf);
|
||||
#endif
|
||||
return std::wcslen(localbuf) + 1;
|
||||
}
|
||||
if(code <= (int)REG_E_UNKNOWN)
|
||||
|
@ -135,3 +135,4 @@ compile test_windows_defs_3.cpp ;
|
||||
compile test_windows_defs_4.cpp ;
|
||||
|
||||
run issue153.cpp : : : "<toolset>msvc:<linkflags>-STACK:2097152" ;
|
||||
run issue227.cpp ;
|
||||
|
@ -19,4 +19,4 @@ target_link_libraries(quick_icu Boost::regex_icu)
|
||||
enable_testing()
|
||||
add_test(quick_icu quick_icu)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
19
test/issue227.cpp
Normal file
19
test/issue227.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2024
|
||||
* Christian Mazakas
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
#include <string>
|
||||
|
||||
int main() {
|
||||
boost::regex rx("(*ACCEPT)*+\\1((*ACCEPT)*+\\K)");
|
||||
std::string str = "Z";
|
||||
boost::smatch what;
|
||||
boost::regex_search(str, what, rx, boost::match_default | boost::match_partial);
|
||||
}
|
Reference in New Issue
Block a user