mirror of
https://github.com/tstack/lnav
synced 2024-11-19 15:25:34 +00:00
Merge pull request #506 from phord/master
string2level uses wrong string length
This commit is contained in:
commit
09e7e14167
@ -108,7 +108,8 @@ logline::level_t logline::string2level(const char *levelstr, ssize_t len, bool e
|
|||||||
pcre_context_static<10> pc;
|
pcre_context_static<10> pc;
|
||||||
|
|
||||||
if (LEVEL_RE.match(pc, pi)) {
|
if (LEVEL_RE.match(pc, pi)) {
|
||||||
retval = abbrev2level(pi.get_substr_start(pc.begin()), len);
|
auto iter = pc.begin();
|
||||||
|
retval = abbrev2level(pi.get_substr_start(iter), pi.get_substr_len(iter));
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -227,6 +227,11 @@ public:
|
|||||||
return &this->pi_string[iter->c_begin];
|
return &this->pi_string[iter->c_begin];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
size_t get_substr_len(pcre_context::const_iterator iter) const
|
||||||
|
{
|
||||||
|
return iter->length();
|
||||||
|
};
|
||||||
|
|
||||||
std::string get_substr(pcre_context::const_iterator iter) const
|
std::string get_substr(pcre_context::const_iterator iter) const
|
||||||
{
|
{
|
||||||
if (iter->c_begin == -1) {
|
if (iter->c_begin == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user