]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix two bugs.
authorcvs <cvs@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Oct 1999 15:57:42 +0000 (15:57 +0000)
committercvs <cvs@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Oct 1999 15:57:42 +0000 (15:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@1742 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/parameter_handler.cc

index e75d4371b1a6aa126a71cf709564308d82fab3bc..223b143bb2490dfe1b31e410e72ce19cb7f0d05d 100644 (file)
@@ -108,7 +108,7 @@ bool Patterns::MultipleSelection::match (const string &test_string_list) const {
   list<string> 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);
 };
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.