Skip to content

Commit c52e2d6

Browse files
aclipaulfd
authored andcommitted
skip over leading spaces of any command. Fixes the problem where leading spaces would confuse the interpreter
1 parent bb8c104 commit c52e2d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clients/jack_client.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ void cliThreadProc()
226226

227227
std::string command;
228228
std::getline(std::cin, command);
229-
std::size_t pos = command.find(" ");
230-
std::string kw = command.substr(0, pos);
229+
std::size_t start = command.length()? command.find_first_not_of(" "): 0;
230+
std::size_t pos = command.find(" ", start);
231+
std::string kw = command.substr(start, pos - start);
231232
std::string args = command.substr(pos + 1);
232233
std::vector<std::string> tokens = stringTokenize(args);
233234

0 commit comments

Comments
 (0)