From 3037e00cf92dbe072c02ab46e930007fef201d54 Mon Sep 17 00:00:00 2001 From: kcwu Date: Sat, 12 Jan 2008 17:39:44 +0000 Subject: - bbslua: minor revise git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3831 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbslua.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbslua.c b/mbbsd/bbslua.c index 52247a44..7e755b5e 100644 --- a/mbbsd/bbslua.c +++ b/mbbsd/bbslua.c @@ -1153,12 +1153,6 @@ bbslua(const char *fpath) int lineshift; AllocData ad; - alloc_init(&ad); - L = lua_newstate(allocf, &ad); - if (!L) - return 0; - lua_atpanic(L, &panic); - #ifdef UMODE_BBSLUA unsigned int prevmode = getutmpmode(); #endif @@ -1167,6 +1161,13 @@ bbslua(const char *fpath) if (runningBBSLua) return 0; + // init lua + alloc_init(&ad); + L = lua_newstate(allocf, &ad); + if (!L) + return 0; + lua_atpanic(L, &panic); + abortBBSLua = 0; // detect file -- cgit v1.2.3