diff options
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.146 2005/06/28 13:01:50 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.147 2005/08/25 15:39:16 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -137,8 +137,7 @@ static int dolibrary (lua_State *L, const char *name) { | |||
137 | 137 | ||
138 | static const char *get_prompt (lua_State *L, int firstline) { | 138 | static const char *get_prompt (lua_State *L, int firstline) { |
139 | const char *p; | 139 | const char *p; |
140 | lua_pushstring(L, firstline ? "_PROMPT" : "_PROMPT2"); | 140 | lua_getfield(L, LUA_GLOBALSINDEX, firstline ? "_PROMPT" : "_PROMPT2"); |
141 | lua_rawget(L, LUA_GLOBALSINDEX); | ||
142 | p = lua_tostring(L, -1); | 141 | p = lua_tostring(L, -1); |
143 | if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); | 142 | if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); |
144 | lua_pop(L, 1); /* remove global */ | 143 | lua_pop(L, 1); /* remove global */ |