diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-21 17:48:35 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-21 17:48:35 -0800 |
commit | f545fb2491d36e02dc6c4005ada86be8678bba78 (patch) | |
tree | 3237ef337b1723b24dc32618cc5e03360e30e13e /builtin_commandline.cpp | |
parent | e73be48d9622d06039926fd2ba4a4b68b675f34a (diff) |
Work towards refactoring tokenizer to be a real object
Diffstat (limited to 'builtin_commandline.cpp')
-rw-r--r-- | builtin_commandline.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin_commandline.cpp b/builtin_commandline.cpp index cb3ee9e3..07dc2c96 100644 --- a/builtin_commandline.cpp +++ b/builtin_commandline.cpp @@ -143,7 +143,6 @@ static void write_part(const wchar_t *begin, int cut_at_cursor, int tokenize) { - tokenizer tok; wcstring out; wchar_t *buff; size_t pos; @@ -155,9 +154,8 @@ static void write_part(const wchar_t *begin, buff = wcsndup(begin, end-begin); // fwprintf( stderr, L"Subshell: %ls, end char %lc\n", buff, *end ); out.clear(); - - for (tok_init(&tok, buff, TOK_ACCEPT_UNFINISHED); - tok_has_next(&tok); + tokenizer_t tok(buff, TOK_ACCEPT_UNFINISHED); + for (; tok_has_next(&tok); tok_next(&tok)) { if ((cut_at_cursor) && |