]> git.donarmstrong.com Git - mothur.git/blobdiff - engine.cpp
removed various build warnings
[mothur.git] / engine.cpp
index 5e82d1344d9fa068078e0176b1e655a8290cd42b..2b1c802e86b6535dbbca645058f5ac55dd2a22ad 100644 (file)
@@ -181,7 +181,7 @@ string Engine::getCommand()  {
                                
                                if(nextCommand != NULL) {  add_history(nextCommand);  } 
                                else{ //^D causes null string and we want it to quit mothur
-                                       nextCommand = "quit"
+                                       strcpy(nextCommand, "quit")
                                        mout->mothurOut(nextCommand);
                                }       
                                
@@ -199,7 +199,7 @@ string Engine::getCommand()  {
                                string nextCommand = "";
                                
                                mout->mothurOut("mothur > ");
-                               m->getline(cin, nextCommand);
+                               getline(cin, nextCommand);
                                mout->mothurOutJustToLog(toString(nextCommand));
                                
                                return nextCommand;
@@ -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++;