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 {
39
39
40
40
41
41
Regex::Regex (const std::string& pattern_)
42
- : pattern(pattern_.empty() ? " .*" : pattern_)
43
- {
42
+ : pattern(pattern_.empty() ? " .*" : pattern_) {
44
43
const char *errptr = NULL ;
45
44
int erroffset;
46
45
@@ -108,8 +107,7 @@ int Regex::search(const std::string& s, SMatch *match) const {
108
107
if (ret > 0 ) {
109
108
*match = SMatch (
110
109
std::string (s, ovector[ret-1 ], ovector[ret] - ovector[ret-1 ]),
111
- 0
112
- );
110
+ 0 );
113
111
}
114
112
115
113
return ret;
Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ namespace Utils {
31
31
32
32
class SMatch {
33
33
public:
34
- SMatch ()
35
- : m_match(), m_offset( 0 )
36
- { }
34
+ SMatch () :
35
+ m_match (),
36
+ m_offset ( 0 ) { }
37
37
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) { }
41
41
42
42
const std::string& str () const { return m_match; }
43
43
size_t offset () const { return m_offset; }
@@ -47,6 +47,7 @@ class SMatch {
47
47
size_t m_offset;
48
48
};
49
49
50
+
50
51
class Regex {
51
52
public:
52
53
explicit Regex (const std::string& pattern_);
@@ -66,14 +67,17 @@ class Regex {
66
67
pcre_extra *m_pce = NULL ;
67
68
};
68
69
70
+
69
71
static inline int regex_search (const std::string& s, SMatch *match, const Regex& regex) {
70
72
return regex.search (s, match);
71
73
}
72
74
75
+
73
76
static inline int regex_search (const std::string& s, const Regex& regex) {
74
77
return regex.search (s);
75
78
}
76
79
80
+
77
81
} // namespace Utils
78
82
} // namespace modsecurity
79
83
You can’t perform that action at this time.
0 commit comments