summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2008-08-20 11:05:40 +0000
committerpixel <pixel>2008-08-20 11:05:40 +0000
commit1b6792a38bd21cd4f6853bb88930231cbda8722c (patch)
tree9103afab76e3f668a9b417a59913f9379650bdf5
parenta18a99bb2d43f7c4fc19b30a8f12d81e8ab996af (diff)
Avoiding _G infinite recursion while dumping.
-rw-r--r--lib/BLua.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/BLua.cc b/lib/BLua.cc
index 9f33284..c96d53d 100644
--- a/lib/BLua.cc
+++ b/lib/BLua.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: BLua.cc,v 1.62 2008-07-18 14:01:13 pixel Exp $ */
+/* $Id: BLua.cc,v 1.63 2008-08-20 11:05:40 pixel Exp $ */
#include <stdlib.h>
#include "BLua.h"
@@ -924,6 +924,11 @@ void Lua::dumpvars_r(Handle * h, int i, int depth) throw (GeneralException) {
depth++;
while(lua_next(L, i) != 0) {
+ if (lua_type(L, -2) == LUA_TSTRING) {
+ if (lua_tostring(L, -2) == String("_G")) {
+ continue;
+ }
+ }
for (j = 0; j < depth; j++) {
(*h) << " ";
}