diff options
Diffstat (limited to 'src/script/cmdtoken.cpp')
-rw-r--r-- | src/script/cmdtoken.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/script/cmdtoken.cpp b/src/script/cmdtoken.cpp index da4a886..6393505 100644 --- a/src/script/cmdtoken.cpp +++ b/src/script/cmdtoken.cpp @@ -35,6 +35,16 @@ char* SkipSpace(char *line) return line; } +std::string GetCmd(char* line) +{ + line = SkipSpace(line); + + int len = 0; + for(char* x = line; *x != 0 && *x != ' ' && *x != '\t' && *x != '\n'; x++, len++); + + return std::string(line, len); +} + // Checks if a line contains a command. bool Cmd(char *line, const char *token) |