summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ltablib.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ltablib.js b/src/ltablib.js
index 70ff595..9998f3c 100644
--- a/src/ltablib.js
+++ b/src/ltablib.js
@@ -131,6 +131,7 @@ const tmove = function(L) {
const tconcat = function(L) {
let last = aux_getn(L, 1, TAB_R);
let sep = lauxlib.luaL_optlstring(L, 2, lua.to_luastring(""));
+ let lsep = sep.length;
let i = lauxlib.luaL_optinteger(L, 3, 1);
last = lauxlib.luaL_optinteger(L, 4, last);
@@ -139,7 +140,7 @@ const tconcat = function(L) {
for (; i < last; i++) {
addfield(L, b, i);
- lauxlib.luaL_addlstring(b, sep);
+ lauxlib.luaL_addlstring(b, sep, lsep);
}
if (i === last)