|
|
@@ -12,10 +12,11 @@ namespace bx
|
|
|
// Reference:
|
|
|
// - https://web.archive.org/web/20180629044234/https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
|
|
|
//
|
|
|
- const char* tokenizeCommandLine(const char* _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term)
|
|
|
+ const char* tokenizeCommandLine(const StringView& _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term)
|
|
|
{
|
|
|
int32_t argc = 0;
|
|
|
- const char* curr = _commandLine;
|
|
|
+ const char* curr = _commandLine.getPtr();
|
|
|
+ const char* end = _commandLine.getTerm();
|
|
|
char* currOut = _buffer;
|
|
|
char term = ' ';
|
|
|
bool sub = false;
|
|
|
@@ -31,7 +32,7 @@ namespace bx
|
|
|
|
|
|
ParserState state = SkipWhitespace;
|
|
|
|
|
|
- while ('\0' != *curr
|
|
|
+ while (end != curr
|
|
|
&& _term != *curr
|
|
|
&& argc < _maxArgvs)
|
|
|
{
|