mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Check regex_match result when parsing cvslog
Spotted by coverity.
This commit is contained in:
parent
c09a693d24
commit
ca217fbfaa
@ -734,12 +734,14 @@ void CVS::getRevisionInfo()
|
||||
LYXERR(Debug::LYXVC, line << '\n');
|
||||
if (prefixIs(line, "date:")) {
|
||||
smatch sm;
|
||||
regex_match(line, sm, reg);
|
||||
//sm[0]; // whole matched string
|
||||
rev_date_cache_ = sm[1];
|
||||
rev_time_cache_ = sm[2];
|
||||
//sm[3]; // GMT offset
|
||||
rev_author_cache_ = sm[4];
|
||||
if (regex_match(line, sm, reg)) {
|
||||
//sm[0]; // whole matched string
|
||||
rev_date_cache_ = sm[1];
|
||||
rev_time_cache_ = sm[2];
|
||||
//sm[3]; // GMT offset
|
||||
rev_author_cache_ = sm[4];
|
||||
} else
|
||||
LYXERR(Debug::LYXVC, "\tCannot parse line. Skipping.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user