File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -290,10 +290,28 @@ bool GOESRProduct::matchProduct(const std::vector<std::string>& products) const
290290 return true ;
291291 }
292292
293+ // Check for a positive match.
293294 const auto begin = std::begin (products);
294295 const auto end = std::end (products);
295296 const auto it = std::find (begin, end, product_.nameShort );
296- return it != end;
297+ if (it != end) {
298+ return true ;
299+ }
300+
301+ // Check for a negative match.
302+ bool performed_negative_check = false ;
303+ for (const auto & product : products) {
304+ if (product.empty () || product.at (0 ) != ' ^' ) {
305+ continue ;
306+ }
307+ // Compare the sub-string after the negation character.
308+ performed_negative_check = true ;
309+ if (product.substr (1 ) == product_.nameShort ) {
310+ return false ;
311+ }
312+ }
313+
314+ return performed_negative_check;
297315}
298316
299317bool GOESRProduct::matchRegion (const std::vector<std::string>& regions) const {
You can’t perform that action at this time.
0 commit comments