From 6285c9e04135f54f2eac3e28a1c3afb249467f6f Mon Sep 17 00:00:00 2001 From: Daniel Warner Date: Sun, 10 Apr 2011 00:52:11 +0100 Subject: [PATCH] If '-' in Tle pattern, valid characters are '+' or '-' --- Tle.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tle.cpp b/Tle.cpp index 4d89624..9c47d68 100644 --- a/Tle.cpp +++ b/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++;