This commit is contained in:
CPunch 2021-01-19 22:56:52 -06:00
parent 71e9331551
commit 185e6027e7

View File

@ -245,7 +245,7 @@ int cosmoB_sSplit(CState *state, int nargs, CValue *args) {
nIndx = strstr(indx, ptrn->str); nIndx = strstr(indx, ptrn->str);
cosmoV_pushNumber(state, nEntries++); cosmoV_pushNumber(state, nEntries++);
cosmoV_pushLString(state, indx, nIndx == NULL ? (indx - str->str) - str->length : nIndx - indx); cosmoV_pushLString(state, indx, nIndx == NULL ? str->length - (indx - str->str) : nIndx - indx);
indx = nIndx + ptrn->length; indx = nIndx + ptrn->length;
} while (nIndx != NULL); } while (nIndx != NULL);