File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,7 @@ namespace Utils {
3939
4040
4141Regex::Regex (const std::string& pattern_)
42- : pattern(pattern_.empty() ? " .*" : pattern_)
43- {
42+ : pattern(pattern_.empty() ? " .*" : pattern_) {
4443 const char *errptr = NULL ;
4544 int erroffset;
4645
@@ -108,8 +107,7 @@ int Regex::search(const std::string& s, SMatch *match) const {
108107 if (ret > 0 ) {
109108 *match = SMatch (
110109 std::string (s, ovector[ret-1 ], ovector[ret] - ovector[ret-1 ]),
111- 0
112- );
110+ 0 );
113111 }
114112
115113 return ret;
Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ namespace Utils {
3131
3232class SMatch {
3333 public:
34- SMatch ()
35- : m_match(), m_offset( 0 )
36- { }
34+ SMatch () :
35+ m_match (),
36+ m_offset ( 0 ) { }
3737
38- SMatch (const std::string &match, size_t offset)
39- : m_match(match), m_offset(offset)
40- { }
38+ SMatch (const std::string &match, size_t offset) :
39+ m_match (match),
40+ m_offset (offset) { }
4141
4242 const std::string& str () const { return m_match; }
4343 size_t offset () const { return m_offset; }
@@ -47,6 +47,7 @@ class SMatch {
4747 size_t m_offset;
4848};
4949
50+
5051class Regex {
5152 public:
5253 explicit Regex (const std::string& pattern_);
@@ -66,14 +67,17 @@ class Regex {
6667 pcre_extra *m_pce = NULL ;
6768};
6869
70+
6971static inline int regex_search (const std::string& s, SMatch *match, const Regex& regex) {
7072 return regex.search (s, match);
7173}
7274
75+
7376static inline int regex_search (const std::string& s, const Regex& regex) {
7477 return regex.search (s);
7578}
7679
80+
7781} // namespace Utils
7882} // namespace modsecurity
7983
You can’t perform that action at this time.
0 commit comments