aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-18 23:55:31 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-19 00:09:54 +1000
commit91f577147002fe47ed86d5e47be43e0d280e82d0 (patch)
tree22a8925c3fcd9fb9c5c8b231580774118f901d5a /src
parent7d92ac87e406dc466d5bec5441c64f0051bda204 (diff)
downloadfengari-91f577147002fe47ed86d5e47be43e0d280e82d0.tar.gz
fengari-91f577147002fe47ed86d5e47be43e0d280e82d0.tar.bz2
fengari-91f577147002fe47ed86d5e47be43e0d280e82d0.zip
src/lstrlib.js: slice only what is required
Diffstat (limited to 'src')
-rw-r--r--src/lstrlib.js2
1 files changed, 1 insertions, 1 deletions
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 {