diff -r 2fe1d68a102c -r ccfb9b8ab9d1 hedgewars/LuaPas.pas --- a/hedgewars/LuaPas.pas Thu Aug 11 23:07:45 2011 -0400 +++ b/hedgewars/LuaPas.pas Fri Aug 12 10:36:37 2011 -0400 @@ -416,7 +416,7 @@ procedure lua_setglobal(L : Plua_State; s : PChar); procedure lua_getglobal(L : Plua_State; s : PChar); -function lua_tostring(L : Plua_State; idx : LongInt) : PChar; +function lua_tostring(L : Plua_State; idx : LongInt) : shortstring; (* @@ -757,7 +757,7 @@ implementation uses - SysUtils; + SysUtils, Strings; (*****************************************************************************) (* luaconfig.h *) @@ -872,9 +872,9 @@ lua_getfield(L, LUA_GLOBALSINDEX, s); end; -function lua_tostring(L : Plua_State; idx : LongInt) : PChar; +function lua_tostring(L : Plua_State; idx : LongInt) : shortstring; begin - lua_tostring := lua_tolstring(L, idx, nil); + lua_tostring := Strings.StrPas(lua_tolstring(L, idx, nil)); end; function lua_open : Plua_State;