If '-' in Tle pattern, valid characters are '+' or '-'

feature/19
Daniel Warner 2011-04-10 00:52:11 +01:00
parent 5829dbd88e
commit 6285c9e041
1 changed files with 9 additions and 1 deletions

10
Tle.cpp
View File

@ -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++;