From 973991b1ad79bff8fc2dc7e398433e5ea5ff6db9 Mon Sep 17 00:00:00 2001 From: cvs Date: Tue, 5 Oct 1999 15:57:42 +0000 Subject: [PATCH] Fix two bugs. git-svn-id: https://svn.dealii.org/trunk@1742 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/source/parameter_handler.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index e75d4371b1..223b143bb2 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -108,7 +108,7 @@ bool Patterns::MultipleSelection::match (const string &test_string_list) const { list split_list; // first split the input list - while (tmp.length()) + while (tmp.length() != 0) { string name; name = tmp; @@ -121,7 +121,8 @@ bool Patterns::MultipleSelection::match (const string &test_string_list) const { else tmp = ""; - while (name[0] == ' ') + while ((name.length() != 0) && + (name[0] == ' ')) name.erase (0,1); while (name[name.length()-1] == ' ') name.erase (name.length()-1, 1); @@ -141,8 +142,12 @@ bool Patterns::MultipleSelection::match (const string &test_string_list) const { { if (*test_string == string(tmp, 0, tmp.find('|'))) { + // string found, quit + // loop. don't change + // tmp, since we don't + // need it anymore. string_found = true; - continue; + break; }; tmp.erase (0, tmp.find('|')+1); @@ -167,7 +172,7 @@ string Patterns::MultipleSelection::description () const { Patterns::PatternBase * Patterns::MultipleSelection::clone () const { - return new Patterns::Selection(sequence); + return new Patterns::MultipleSelection(sequence); }; -- 2.39.5