UTF8String: fix substr() calls with len == null, closes #1167

This commit is contained in:
Jens Fischer
2018-03-20 20:51:07 +01:00
committed by Joshua Granick
parent e2499abaab
commit 0dbbbe9381

View File

@@ -174,6 +174,12 @@ abstract UTF8String(String) from String to String {
**/
public function substr (pos:Int, ?len:Int):String {
if (len == null) {
len = (this:UTF8String).length - pos;
}
return Utf8.sub (this, pos, len);
}