From 478ffdad62482192fd92a8a8f18275c28cfd6826 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 15:05:35 +0100 Subject: Fixed bad long string parsing --- src/llex.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/llex.js b/src/llex.js index 9983c1d..bf7463c 100644 --- a/src/llex.js +++ b/src/llex.js @@ -356,7 +356,14 @@ const read_long_string = function(ls, seminfo, sep) { } if (seminfo) - seminfo.ts = new TValue(CT.LUA_TLNGSTR, lua.to_luastring(ls.buff.buffer.slice(2 + sep).join(''))); + seminfo.ts = new TValue( + CT.LUA_TLNGSTR, + lua.to_luastring( + ls.buff.buffer + .slice(2 + sep, 2 + sep - 2 * (2 + sep)) + .join('') + ) + ); }; const esccheck = function(ls, c, msg) { -- cgit v1.2.3-70-g09d2