skip over leading spaces of any command. Fixes the problem where leading spaces would confuse the interpreter
This commit is contained in:
parent
bb8c104b05
commit
c52e2d6f33
1 changed files with 3 additions and 2 deletions
|
|
@ -226,8 +226,9 @@ void cliThreadProc()
|
|||
|
||||
std::string command;
|
||||
std::getline(std::cin, command);
|
||||
std::size_t pos = command.find(" ");
|
||||
std::string kw = command.substr(0, pos);
|
||||
std::size_t start = command.length()? command.find_first_not_of(" "): 0;
|
||||
std::size_t pos = command.find(" ", start);
|
||||
std::string kw = command.substr(start, pos - start);
|
||||
std::string args = command.substr(pos + 1);
|
||||
std::vector<std::string> tokens = stringTokenize(args);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue