From 91f577147002fe47ed86d5e47be43e0d280e82d0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 18 Jun 2017 23:55:31 +1000 Subject: src/lstrlib.js: slice only what is required --- src/lstrlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lstrlib.js b/src/lstrlib.js index 0d67903..7a2283c 100644 --- a/src/lstrlib.js +++ b/src/lstrlib.js @@ -1119,7 +1119,7 @@ const match = function(ms, s, p) { const push_onecapture = function(ms, i, s, e) { if (i >= ms.level) { if (i === 0) - lua.lua_pushlstring(ms.L, ms.src.slice(s), e - s); /* add whole match */ + lua.lua_pushlstring(ms.L, ms.src.slice(s, e), e - s); /* add whole match */ else lauxlib.luaL_error(ms.L, lua.to_luastring("invalid capture index %%%d"), i + 1); } else { -- cgit v1.2.3-70-g09d2