Browse Source

Use the new context API to get shell from context; Cleanup unneeded cast

Stanislav Galabov 11 years ago
parent
commit
54b74d8cc1
2 changed files with 3 additions and 3 deletions
  1. 2 2
      plugins/lua/lua_action.c
  2. 1 1
      plugins/lua/plugin_init.c

+ 2 - 2
plugins/lua/lua_action.c

@@ -23,8 +23,8 @@ static int exec_action(lua_State *L, const char *script)
 
 CLISH_PLUGIN_SYM(clish_plugin_lua_action)
 {
-	clish_context_t *context = (clish_context_t *) clish_context;
-	lua_State *L = clish_shell__get_udata(context->shell, LUA_UDATA);
+	clish_shell_t *shell = clish_context__get_shell(clish_context);
+	lua_State *L = clish_shell__get_udata(shell, LUA_UDATA);
 	konf_buf_t *buf;
 	pid_t childpid;
 	int res = 0, origstdout = -1, fd[2];

+ 1 - 1
plugins/lua/plugin_init.c

@@ -31,7 +31,7 @@ CLISH_PLUGIN_INIT
 		scripts_path = trim(conf);
 	}
 
-	if(clish_plugin_init_lua((clish_shell_t *)clish_shell))
+	if(clish_plugin_init_lua(clish_shell))
 		return (-1);
 
 	clish_plugin__set_name(plugin, "lua_hooks");