From 6b426b1da1e1d1f2340a6f01f6d275e8fef2e3d1 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 14 Sep 2009 15:16:15 +0200 Subject: [PATCH] globalconf: move argv out Signed-off-by: Julien Danjou --- awesome.c | 13 ++++++++----- globalconf.h | 2 -- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/awesome.c b/awesome.c index 90955be5..026dc322 100644 --- a/awesome.c +++ b/awesome.c @@ -49,6 +49,9 @@ awesome_t globalconf; +/** argv used to run awesome */ +static char *awesome_argv; + typedef struct { xcb_window_t id; @@ -271,7 +274,7 @@ void awesome_restart(void) { awesome_atexit(); - a_exec(globalconf.argv); + a_exec(awesome_argv); } /** Function to restart awesome on some signals. @@ -370,13 +373,13 @@ main(int argc, char **argv) for(i = 0; i < argc; i++) cmdlen += a_strlen(argv[i]) + 1; - globalconf.argv = p_new(char, cmdlen); - a_strcpy(globalconf.argv, cmdlen, argv[0]); + awesome_argv = p_new(char, cmdlen); + a_strcpy(awesome_argv, cmdlen, argv[0]); for(i = 1; i < argc; i++) { - a_strcat(globalconf.argv, cmdlen, " "); - a_strcat(globalconf.argv, cmdlen, argv[i]); + a_strcat(awesome_argv, cmdlen, " "); + a_strcat(awesome_argv, cmdlen, argv[i]); } /* Text won't be printed correctly otherwise */ diff --git a/globalconf.h b/globalconf.h index 08da5512..01ece7af 100644 --- a/globalconf.h +++ b/globalconf.h @@ -81,8 +81,6 @@ typedef struct char *conffile; /** Stack client history */ client_array_t stack; - /** Command line passed to awesome */ - char *argv; /** Lua VM state */ lua_State *L; /** Default colors */