Fix string.match for empty pattern

This commit is contained in:
Enyby
2018-12-16 06:38:23 +02:00
committed by GitHub
parent 47f8d6e6fc
commit e61e5694fa

View File

@@ -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;
}