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