Fix string.match for empty pattern
This commit is contained in:
@@ -775,7 +775,7 @@ public class StringLib extends TwoArgFunction {
|
||||
|
||||
boolean anchor = false;
|
||||
int poff = 0;
|
||||
if ( pat.luaByte( 0 ) == '^' ) {
|
||||
if ( pat.length() > 0 && pat.luaByte( 0 ) == '^' ) {
|
||||
anchor = true;
|
||||
poff = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user