Browse Source

Fix substr on empty string

Pascal Peridont 19 years ago
parent
commit
3e38ac361e
1 changed files with 1 additions and 0 deletions
  1. 1 0
      std/neko/NekoString__.hx

+ 1 - 0
std/neko/NekoString__.hx

@@ -115,6 +115,7 @@ class NekoString__ implements String {
 			len = sl - pos;
 		}
 
+		if( pos < 0 || len <= 0 ) return "";
 		return untyped new String(__dollar__ssub(this.__s,pos,len));
 	}