UTF8String: fix substr() calls with len == null, closes #1167
This commit is contained in:
committed by
Joshua Granick
parent
e2499abaab
commit
0dbbbe9381
@@ -174,6 +174,12 @@ abstract UTF8String(String) from String to String {
|
|||||||
**/
|
**/
|
||||||
public function substr (pos:Int, ?len:Int):String {
|
public function substr (pos:Int, ?len:Int):String {
|
||||||
|
|
||||||
|
if (len == null) {
|
||||||
|
|
||||||
|
len = (this:UTF8String).length - pos;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return Utf8.sub (this, pos, len);
|
return Utf8.sub (this, pos, len);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user