]> git.donarmstrong.com Git - mothur.git/blobdiff - engine.cpp
removed line option
[mothur.git] / engine.cpp
index 2215e081af76c8c2ccb3064aebe8d04dc6a94818..0a0f5a0ce7f0f4f0a120509e2c3d5c0e51471ecb 100644 (file)
@@ -121,8 +121,6 @@ bool BatchEngine::getInput(){
                        if (inputBatchFile.eof()) { input = "quit()"; }
                        else { input = getline(inputBatchFile); }
                        
-                       
-                       
                        if (input[0] != '#') {
                                
                                mothurOutEndLine();
@@ -244,13 +242,21 @@ bool ScriptEngine::getInput(){
 string ScriptEngine::getNextCommand(string& commandString) {
        try {
                string nextcommand = "";
+               int count = 0;
                
-               nextcommand = commandString.substr(0,commandString.find_first_of(';'));
-
+               //go through string until you reach ; or end
+               while (count < commandString.length()) { 
+                       
+                       if (commandString[count] == ';') {  break;   }
+                       else {          nextcommand += commandString[count];    }
+                       
+                       count++;
+               }
+               
+               //if you are not at the end
+               if (count != commandString.length())  {   commandString = commandString.substr(count+1, commandString.length());  }
+               else { commandString = ""; }
                                
-               if ((commandString.find_first_of(';')+1) <= commandString.length()) {
-                       commandString = commandString.substr(commandString.find_first_of(';')+1, commandString.length());
-               }else { commandString = ""; } //you have reached the last command.
                
                //get rid of spaces in between commands if any
                if (commandString.length() > 0) {