From db1df45494330a0e63a5a14255ac8e2a503e46ea 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 5ba25846..00d75f8b 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -1916,11 +1916,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;