From b754c8e18bbbefc3ea01a7a1939227a67f0ca328 Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Tue, 15 Dec 2015 20:24:41 -0800 Subject: [PATCH] Update pretty printing in debugging to generate valid Lua code for userdata-like types. --- src/scripting.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting.c b/src/scripting.c index bec488b3..0a845bf3 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -1911,11 +1911,11 @@ sds ldbCatStackValue(sds s, lua_State *lua, int idx) { else if (t == LUA_TUSERDATA) typename = "userdata"; else if (t == LUA_TTHREAD) typename = "thread"; else if (t == LUA_TLIGHTUSERDATA) typename = "light-userdata"; - s = sdscatprintf(s,"%s@%p",typename,p); + s = sdscatprintf(s,"\"%s@%p\"",typename,p); } break; default: - s = sdscat(s,""); + s = sdscat(s,"\"\""); break; } return s;