X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=engine.cpp;h=a90bb7e0588baee4f8d922687f99063c8d961387;hb=ca0785e447ca7aa7e2f0ab8bb1155db126b551ea;hp=54524ba9e6a8aa3fe8b678abf060db68529b7177;hpb=4745a956b3116a719f52f341d2a2db84df4817da;p=mothur.git diff --git a/engine.cpp b/engine.cpp index 54524ba..a90bb7e 100644 --- a/engine.cpp +++ b/engine.cpp @@ -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++;