summaryrefslogtreecommitdiff
path: root/src/lstrlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-15 00:51:31 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-15 00:51:31 +1000
commitd39203f46fa4d7b3f95c762faeb0a9277f87d167 (patch)
tree726fb5197bb4349e9a94392d731de9a9e9dec42c /src/lstrlib.js
parent2105854719431aa7a9288ad3647a67883224d150 (diff)
downloadfengari-d39203f46fa4d7b3f95c762faeb0a9277f87d167.tar.gz
fengari-d39203f46fa4d7b3f95c762faeb0a9277f87d167.tar.bz2
fengari-d39203f46fa4d7b3f95c762faeb0a9277f87d167.zip
src/lstrlib.js: Pass string (not offset of string)
Diffstat (limited to 'src/lstrlib.js')
-rw-r--r--src/lstrlib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js
index d224a56..d0d1646 100644
--- a/src/lstrlib.js
+++ b/src/lstrlib.js
@@ -1312,7 +1312,7 @@ const add_value = function(ms, b, s, e, tr) {
}
if (!lua.lua_toboolean(L, -1)) { /* nil or false? */
lua.lua_pop(L, 1);
- lua.lua_pushlstring(L, s, e - s); /* keep original text */
+ lua.lua_pushlstring(L, ms.src.slice(s, e), e - s); /* keep original text */
} else if (!lua.lua_isstring(L, -1))
lauxlib.luaL_error(L, lua.to_luastring("invalid replacement value (a %s)"), lauxlib.luaL_typename(L, -1));
lauxlib.luaL_addvalue(b); /* add result to accumulator */