l_version may be local to 'lua_version'

This commit is contained in:
Roberto Ierusalimschy 2009-06-19 11:21:23 -03:00
parent 4a818f068a
commit 02504d86d3
1 changed files with 3 additions and 4 deletions

7
lapi.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.82 2009/06/18 16:36:40 roberto Exp roberto $
** $Id: lapi.c,v 2.83 2009/06/18 18:59:18 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@ -129,10 +129,9 @@ LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
}
static const lua_Number l_version = LUA_VERSION_NUM;
LUA_API const lua_Number *lua_version (lua_State *L) {
if (L == NULL) return &l_version;
static const lua_Number version = LUA_VERSION_NUM;
if (L == NULL) return &version;
else return G(L)->version;
}