Bugfix: Correctly restart i3 when not using its absolute path
This commit is contained in:
@ -607,8 +607,8 @@ void parse_command(xcb_connection_t *conn, const char *command) {
|
||||
|
||||
/* Is it <restart>? 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 */
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user