From d39203f46fa4d7b3f95c762faeb0a9277f87d167 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 15 Jun 2017 00:51:31 +1000 Subject: src/lstrlib.js: Pass string (not offset of string) --- src/lstrlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- cgit v1.2.3-70-g09d2