From 987897357a7e0243887f4aceaccac6d4f13e6a0c Mon Sep 17 00:00:00 2001 From: Sainan Date: Thu, 7 Sep 2023 07:09:06 +0200 Subject: [PATCH] dumpvar: Prefix strings with "string(len) " --- src/lbaselib.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lbaselib.cpp b/src/lbaselib.cpp index 41952d5bb9..0f0e7bfab8 100644 --- a/src/lbaselib.cpp +++ b/src/lbaselib.cpp @@ -589,6 +589,12 @@ static void luaB_dumpvar_impl (lua_State *L, int indents, Table *recursion_marke const char *s = lua_tolstring(L, -1, &l); luaL_Buffer b; luaL_buffinit(L, &b); + if (!is_export) { + luaL_addstring(&b, "string("); + lua_pushinteger(L, l); + luaL_addvalue(&b); + luaL_addstring(&b, ") "); + } addquoted(&b, s, l); luaL_pushresult(&b); return;