diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-30 21:33:15 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-30 21:33:15 -0800 |
commit | af2d348543f623e30376c54908cfd2eda99fb685 (patch) | |
tree | 94ad4f4a02d6a5f20aaaeb06e4321d391ead16c3 /common.cpp | |
parent | 13f72decf41ff90319295ee4fae8d3743e317386 (diff) |
Substantial modifications of expand_variables to modernize, normalize memory management, adopt C++ types
Diffstat (limited to 'common.cpp')
-rw-r--r-- | common.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1820,10 +1820,11 @@ void tokenize_variable_array2( const wcstring &val, std::vector<wcstring> &out) size_t pos = 0, end = val.size(); while (pos < end) { size_t next_pos = val.find(ARRAY_SEP, pos); - if (next_pos == wcstring::npos) next_pos = end; + if (next_pos == wcstring::npos) break; out.push_back(val.substr(pos, next_pos - pos)); pos = next_pos + 1; //skip the separator } + out.push_back(val.substr(pos, end - pos)); } void tokenize_variable_array( const wchar_t *val, array_list_t *out ) |