Merge remote branch 'origin/topic/seth/fix-do_split'

* origin/topic/seth/fix-do_split:
  Fixed the do_split bug and added a test.
This commit is contained in:
Robin Sommer 2011-04-21 19:42:50 -07:00
commit 9fe52512eb
3 changed files with 16 additions and 0 deletions

View file

@ -244,6 +244,9 @@ Val* do_split(StringVal* str_val, RE_Matcher* re, TableVal* other_sep,
--n;
}
if ( num_sep >= max_num_sep )
offset = end_of_s - s;
Val* ind = new Val(++num, TYPE_COUNT);
a->Assign(ind, new StringVal(offset, (const char*) s));
Unref(ind);