mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
Screen __index: Don't turn argument into a string
Calling lua_tostring() on a number/integer, turns that stack slot into a string. This patch changes the code to only call lua_tostring() if the function argument really is a string. This partly also caused https://github.com/awesomeWM/awesome/issues/238. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
5cf13dba6b
commit
d2f583d839
1 changed files with 1 additions and 1 deletions
|
@ -458,7 +458,7 @@ luaA_screen_module_index(lua_State *L)
|
|||
{
|
||||
const char *name;
|
||||
|
||||
if((name = lua_tostring(L, 2)))
|
||||
if(lua_type(L, 2) == LUA_TSTRING && (name = lua_tostring(L, 2)))
|
||||
foreach(screen, globalconf.screens)
|
||||
foreach(output, (*screen)->outputs)
|
||||
if(A_STREQ(output->name, name))
|
||||
|
|
Loading…
Reference in a new issue