Re: Stack Underflow
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Stack Underflow
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2002年8月28日 13:35:15 -0300
A simpler version could be simply this:
void my_dostring(lua_State *L, const char *cmd)
{
if (luaL_loadbuffer(L, cmd, strlen(cmd), cmd) ||
lua_pcall(L, 0, LUA_MULTRET, 0)) {
fprintf(stderr, "%s\n", lua_tostring(L, -1));
lua_pop(L, 1);
}
}
As lhf pointed out, you don't have to call _ALERT. (Actually, lua does
not define _ALERT anymore, so if you want to call it, you have to define
it.)
-- Roberto