aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 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 */