morgant / mlvwm

Macintosh-like Virtual Window Manager (official repo)
http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html
280 stars 9 forks source link

Restart action doesn't actually support restarting into another window manager #10

Closed morgant closed 3 years ago

morgant commented 3 years ago

The Restart action accepts a window manager command to restart into, but it seems to only restart mlvwm, never into an other such as fvwm. Reviewing RestartSystem() in mlvwm/functions.c, it seems like the strncmp() condition is probably not correct. https://github.com/morgant/mlvwm/blob/e65b6ff507dc5666f22a8523bf41264d09cb72f2/mlvwm/functions.c#L676

morgant commented 3 years ago

Looks like the strncmp() comparison is actually okay, though I would've been a little more explicit with the comparison. That said, command is getting clobbered sometime in Done() in mlvwm/mlvwm.c (Yes, it gets freed in FreeMenu().)

morgant commented 3 years ago

Fixed by strdup()ing the command when sending it to Done() so it doesn't get freed.