]> git.donarmstrong.com Git - mothur.git/blobdiff - engine.cpp
added get.lineage and remove.lineage commands
[mothur.git] / engine.cpp
index 54524ba9e6a8aa3fe8b678abf060db68529b7177..a90bb7e0588baee4f8d922687f99063c8d961387 100644 (file)
@@ -571,11 +571,16 @@ string ScriptEngine::getNextCommand(string& commandString) {
                
                string nextcommand = "";
                int count = 0;
+               bool ignoreSemiColons = false;
                
                //go through string until you reach ; or end
                while (count < commandString.length()) { 
                        
-                       if (commandString[count] == ';') {  break;   }
+                        //you want to ignore any ; until you reach the next '
+                       if ((commandString[count] == '\'') && (!ignoreSemiColons)) {  ignoreSemiColons = true;  } 
+                       else if ((commandString[count] == '\'') && (ignoreSemiColons)) {  ignoreSemiColons = false;  } 
+                               
+                       if ((commandString[count] == ';') && (!ignoreSemiColons)) {  break;   }
                        else {          nextcommand += commandString[count];    }
                        
                        count++;