From e91f399609ea9aadb913a29e3515313101094460 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 1 May 2009 16:10:02 +0200 Subject: [PATCH] Bugfix: Correctly restart i3 when not using its absolute path --- debian/changelog | 1 + include/i3.h | 2 +- src/commands.c | 4 ++-- src/mainx.c | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index d6041d77..a090ebd4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ i3-wm (3.a-bf1-1) unstable; urgency=low etc. * Bugfix: Correctly update state when moving fullscreen windows across workspaces. + * Bugfix: Correctly restart i3 when not using its absolute path * Implement scrolling on stack windows and on the bottom bar. * Create i3-wm-dbg with debug symbols * Don't rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4. diff --git a/include/i3.h b/include/i3.h index 6d6f9d74..a3dfc4c0 100644 --- a/include/i3.h +++ b/include/i3.h @@ -22,7 +22,7 @@ #define NUM_ATOMS 12 -extern char *application_path; +extern char **start_argv; extern Display *xkbdpy; extern TAILQ_HEAD(bindings_head, Binding) bindings; extern SLIST_HEAD(stack_wins_head, Stack_Window) stack_wins; diff --git a/src/commands.c b/src/commands.c index 9f5be8dc..f3e31a3a 100644 --- a/src/commands.c +++ b/src/commands.c @@ -607,8 +607,8 @@ void parse_command(xcb_connection_t *conn, const char *command) { /* Is it ? Then restart in place. */ if (STARTS_WITH(command, "restart")) { - LOG("restarting \"%s\"...\n", application_path); - execl(application_path, application_path, NULL); + LOG("restarting \"%s\"...\n", start_argv[0]); + execvp(start_argv[0], start_argv); /* not reached */ } diff --git a/src/mainx.c b/src/mainx.c index 34daf04e..03390f90 100644 --- a/src/mainx.c +++ b/src/mainx.c @@ -44,7 +44,7 @@ #include "xinerama.h" /* This is the path to i3, copied from argv[0] when starting up */ -char *application_path; +char **start_argv; /* This is our connection to X11 for use with XKB */ Display *xkbdpy; @@ -338,7 +338,7 @@ int main(int argc, char *argv[], char *env[]) { if (!isatty(fileno(stdout))) setbuf(stdout, NULL); - application_path = sstrdup(argv[0]); + start_argv = argv; while ((opt = getopt(argc, argv, "c:v")) != -1) { switch (opt) { -- 2.39.5