Permalink
Browse files

Merge pull request #44 from ThomasAdam/gh/43

command args: trim leading/trailing whitespace
  • Loading branch information...
pbeckingham committed Jul 14, 2018
2 parents 908d2cc + d70e189 commit 1e31121b6f33fafef56252e082a16c86b2a9d414
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/main.cpp
@@ -113,7 +113,13 @@ static int commandLoop (bool autoClear)
}
else if (command != "")
{
auto args = split (command, ' ');
std::vector<std::string> args;
std::string n;
for (const auto& s : split (command, ' '))
{
if ((n = trim(s)) != "")
args.push_back(n);
}

// Dispatch command.
if (args[0] == "<EOF>") status = -1;

0 comments on commit 1e31121

Please sign in to comment.