From f931e0cb8eef222f2de7986c4e25ca4b809fd43c Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 9 May 2009 13:28:57 +0200 Subject: [PATCH] Get the shell for spawn_with_shell earlier My local config got a module which denies functions from adding new functions to the global context or to a module's local context. I use this for catching typos (think misspelled variable names). This patch "fixes" a false-positive which was caused by this. Signed-off-by: Uli Schlachter --- lib/awful/util.lua.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/awful/util.lua.in b/lib/awful/util.lua.in index 83e31566b..5965bda18 100644 --- a/lib/awful/util.lua.in +++ b/lib/awful/util.lua.in @@ -26,6 +26,8 @@ module("awful.util") table = {} +shell = os.getenv("SHELL") or "/bin/sh" + function deprecate(see) io.stderr:write("W: awful: function is deprecated") if see then @@ -79,10 +81,6 @@ end -- @param screen The screen where to run the command. function spawn_with_shell(cmd, screen) if cmd and cmd ~= "" then - -- Get the shell once for all - if not shell then - shell = os.getenv("SHELL") or "/bin/sh" - end cmd = shell .. " -c \"" .. cmd .. "\"" return capi.awesome.spawn(cmd, false, screen or capi.mouse.screen) end