Merge pull request #15 from Enyby/patch-7

Fix gmatch for pass testsuites
This commit was merged in pull request #15.
This commit is contained in:
Benjamin P. Jung
2018-09-14 12:13:34 +02:00
committed by GitHub

View File

@@ -525,12 +525,13 @@ public class StringLib extends TwoArgFunction {
this.soffset = 0;
}
public Varargs invoke(Varargs args) {
for ( ; soffset<srclen; soffset++ ) {
for ( ; soffset<=srclen; soffset++ ) {
ms.reset();
int res = ms.match(soffset, 0);
if ( res >=0 ) {
int soff = soffset;
soffset = res;
if (soff == res) soffset++; /* empty match? go at least one position */
return ms.push_captures( true, soff, res );
}
}