From 4c517cf9d32a6926bf97ac06fcec55b67d9db7bb Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 13 Jun 2015 11:18:47 +0200 Subject: [PATCH] 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 --- screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screen.c b/screen.c index b5716267f..da59345e4 100644 --- a/screen.c +++ b/screen.c @@ -422,7 +422,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))