From: sairajat Date: Mon, 6 Feb 2017 17:09:35 +0000 (-0500) Subject: Fixes bug in Pattern::Selection X-Git-Tag: v8.5.0-rc1~118^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c46a949904061ddd0521f3d655aa0cbf934a231c;p=dealii.git Fixes bug in Pattern::Selection --- diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index ccf56d3c9d..128e2410b3 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -467,6 +467,10 @@ namespace Patterns bool Selection::match (const std::string &test_string) const { std::string tmp(sequence); + // remove whitespace at beginning + while ((tmp.length() != 0) && (std::isspace (tmp[0]))) + tmp.erase (0,1); + // check the different possibilities while (tmp.find('|') != std::string::npos) { @@ -475,6 +479,11 @@ namespace Patterns tmp.erase (0, tmp.find('|')+1); }; + + //remove whitespace at the end + while ((tmp.length() != 0) && (std::isspace (tmp[*(tmp.end()-1)]))) + tmp.erase (tmp.end()-1); + // check last choice, not finished by | if (test_string == tmp) return true;