From c0f391e648f52cd9b8fa6e534a2f97a8ba0f46a9 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Wed, 18 Mar 2020 19:46:53 +0100 Subject: Remove wm menu Whilst arguably useful for certain people, or in rare cases, this functionality is not needed in the general case. This will also remove a memory leak where fallback was not properly freed. --- calmwm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'calmwm.c') diff --git a/calmwm.c b/calmwm.c index d90a754..2f3c4e4 100644 --- a/calmwm.c +++ b/calmwm.c @@ -59,7 +59,7 @@ int main(int argc, char **argv) { char *display_name = NULL; - char *fallback; + char **saved_argv; int ch, xfd, nflag = 0; struct pollfd pfd[1]; @@ -69,8 +69,7 @@ main(int argc, char **argv) conf_init(&Conf); - fallback = u_argv(argv); - Conf.wm_argv = u_argv(argv); + saved_argv = argv; while ((ch = getopt(argc, argv, "c:d:nv")) != -1) { switch (ch) { case 'c': @@ -127,9 +126,8 @@ main(int argc, char **argv) } x_teardown(); if (cwm_status == CWM_EXEC_WM) { - u_exec(Conf.wm_argv); - warnx("'%s' failed to start, starting fallback", Conf.wm_argv); - u_exec(fallback); + execvp(saved_argv[0], saved_argv); + warnx("failed to re-exec"); } return 0; -- cgit v1.2.3-2-gb3c3