diff options
| author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2014-06-25 15:02:03 -0700 |
|---|---|---|
| committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2014-06-25 15:02:03 -0700 |
| commit | 16543a704384a7da0b45fd8053434cca1a0dcfd9 (patch) | |
| tree | 080fb5e958f8f8d58c83ce0a8a14835e4e2b51d6 | |
| parent | cdef8390db6407608634b5a6c31234e34dfe5018 (diff) | |
Fixing tokenize.
| -rw-r--r-- | src/BString.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/BString.cc b/src/BString.cc index 5f4b868..f5bcfee 100644 --- a/src/BString.cc +++ b/src/BString.cc @@ -164,13 +164,12 @@ std::vector<Balau::String> Balau::String::tokenize(const String & delimiters, bo pos = strlen(); if ((pos != lastPos) || !trimEmpty) - tokens.push_back(extract(lastPos, pos)); + tokens.push_back(extract(lastPos, pos - lastPos)); return tokens; - } - else { + } else { if ((pos != lastPos) || !trimEmpty) - tokens.push_back(extract(lastPos, pos)); + tokens.push_back(extract(lastPos, pos - lastPos)); } lastPos = pos + 1; |
