diff -Nur ../celestia-1.4.1/configure.in ./configure.in --- ../celestia-1.4.1/configure.in 2006-02-03 18:09:54.000000000 +0000 +++ ./configure.in 2007-02-12 16:27:42.000000000 +0000 @@ -383,7 +383,7 @@ AC_MSG_CHECKING([whether to enable Celestia Extension Language]) if (test "$enable_lua" != "no"); then CXXFLAGS="$CXXFLAGS -DCELX" - LDFLAGS="$LDFLAGS -llualib -llua" + LDFLAGS="$LDFLAGS -llua" if (test "$lua_includes" != "no"); then CXXFLAGS="$CXXFLAGS -I$lua_includes" diff -Nur ../celestia-1.4.1/src/celestia/celx.cpp ./src/celestia/celx.cpp --- ../celestia-1.4.1/src/celestia/celx.cpp 2006-01-07 00:01:51.000000000 +0000 +++ ./src/celestia/celx.cpp 2007-02-12 16:27:42.000000000 +0000 @@ -32,9 +32,7 @@ #include "celx.h" #include "celestiacore.h" -extern "C" { -#include "lualib.h" -} +#include "lua.hpp" using namespace std; @@ -532,6 +530,8 @@ status = lua_resume(co, narg); if (status == 0) + return 0; + else if (status == LUA_YIELD) { int nres = lua_gettop(co); #if 0 @@ -543,7 +543,7 @@ } else { - lua_xmove(co, L, 1); // move error message + lua_xmove(co, L, -1); // move error message return -1; // error flag } } @@ -598,7 +598,7 @@ int stackTop = lua_gettop(costate); if (strcmp(c_p, "y") == 0) { - lua_iolibopen(costate); + luaL_openlibs(costate); ioMode = IOAllowed; } else @@ -713,7 +713,8 @@ // no other errors, and execution terminates normally. There // should be a better way to figure out whether the script ended // normally . . . - if (strcmp(errorMessage, "cannot resume dead coroutine") != 0) + if (errorMessage + && strcmp(errorMessage, "cannot resume dead coroutine") != 0) { cout << "Error: " << errorMessage << '\n'; CelestiaCore* appCore = getAppCore(co); @@ -4577,10 +4578,7 @@ initMaps(); // Import the base and math libraries - lua_baselibopen(state); - lua_mathlibopen(state); - lua_tablibopen(state); - lua_strlibopen(state); + luaL_openlibs(state); // Add an easy to use wait function, so that script writers can // live in ignorance of coroutines. There will probably be a significant