@@ -1011,8 +1011,8 @@ inline void read_file(const std::string &path, std::string &out) {
1011
1011
1012
1012
inline std::string file_extension (const std::string &path) {
1013
1013
std::smatch m;
1014
- auto pat = std::regex (" \\ .([a-zA-Z0-9]+)$" );
1015
- if (std::regex_search (path, m, pat )) { return m[1 ].str (); }
1014
+ auto re = std::regex (" \\ .([a-zA-Z0-9]+)$" );
1015
+ if (std::regex_search (path, m, re )) { return m[1 ].str (); }
1016
1016
return std::string ();
1017
1017
}
1018
1018
@@ -1898,16 +1898,16 @@ inline bool parse_multipart_formdata(const std::string &boundary,
1898
1898
1899
1899
inline bool parse_range_header (const std::string &s, Ranges &ranges) {
1900
1900
try {
1901
- static auto re = std::regex (R"( bytes=(\d*-\d*(?:,\s*\d*-\d*)*))" );
1901
+ static auto re_first_range = std::regex (R"( bytes=(\d*-\d*(?:,\s*\d*-\d*)*))" );
1902
1902
std::smatch m;
1903
- if (std::regex_match (s, m, re )) {
1903
+ if (std::regex_match (s, m, re_first_range )) {
1904
1904
auto pos = m.position (1 );
1905
1905
auto len = m.length (1 );
1906
1906
detail::split (&s[pos], &s[pos + len], ' ,' ,
1907
1907
[&](const char *b, const char *e) {
1908
- static auto re = std::regex (R"( \s*(\d*)-(\d*))" );
1908
+ static auto re_another_range = std::regex (R"( \s*(\d*)-(\d*))" );
1909
1909
std::cmatch m;
1910
- if (std::regex_match (b, e, m, re )) {
1910
+ if (std::regex_match (b, e, m, re_another_range )) {
1911
1911
ssize_t first = -1 ;
1912
1912
if (!m.str (1 ).empty ()) {
1913
1913
first = static_cast <ssize_t >(std::stoll (m.str (1 )));
0 commit comments