If '-' in Tle pattern, valid characters are '+' or '-'
parent
5829dbd88e
commit
6285c9e041
10
Tle.cpp
10
Tle.cpp
|
@ -229,7 +229,7 @@ bool Tle::ValidateLine(const std::string& line, const std::string& pattern) {
|
|||
while (pattern_itr != pattern.end()) {
|
||||
|
||||
if (isdigit(*pattern_itr) || *pattern_itr == ' ' ||
|
||||
*pattern_itr == '.' || *pattern_itr == '-') {
|
||||
*pattern_itr == '.') {
|
||||
|
||||
/*
|
||||
* these characters should match exactly
|
||||
|
@ -252,6 +252,14 @@ bool Tle::ValidateLine(const std::string& line, const std::string& pattern) {
|
|||
*/
|
||||
if (*line_itr != '+' && *line_itr != '-' && *line_itr != ' ')
|
||||
return false;
|
||||
|
||||
} else if (*pattern_itr == '-') {
|
||||
|
||||
/*
|
||||
* if pattern value is '+' or a '+'
|
||||
*/
|
||||
if (*line_itr != '+' && *line_itr != '-')
|
||||
return false;
|
||||
}
|
||||
|
||||
pattern_itr++;
|
||||
|
|
Loading…
Reference in New Issue