Fix string split when last part is shorter than delimiter
authorKevin Chou <jlz@fb.com>
Wed, 2 Jul 2014 16:14:24 +0000 (09:14 -0700)
committerTudor Bosman <tudorb@fb.com>
Mon, 7 Jul 2014 15:42:01 +0000 (08:42 -0700)
commit02a9ec75b0c1ee5740a07b356d012db64f657dcf
treee2cf586f1e4144dae79af1e14a1bc4df4dca6968
parentd057a592035c6b5149ed1ea5088b122ce402ef41
Fix string split when last part is shorter than delimiter

Summary: The bug is when ignoreEmpty is true, we use the wrong token size, which will be 0 when last token is shorter than delimiter.

Test Plan:
1. Add unit test
2. fbconfig -r folly && fbmake runtests

Reviewed By: philipp@fb.com

Subscribers: maxime, xiaol

FB internal diff: D1415803
folly/String-inl.h
folly/test/StringTest.cpp