Subject: FVWM: Re: parsing in restart_function() in fvwm/builtins.c?

From: Bob Woodside <[email-masked]>
Date: Thu, 21 Aug 1997 22:04:31 -0400 (EDT)

On Wed, 20 Aug 1997, Dan Astoorian <[email-masked]> wrote:

>  I use FvwmButtons, with this line...
>
>      *FvwmButtons Restart icon.xpm     Restart fvwm2

>  When FvwmButtons sends commands to fvwm2, it includes the trailing
>  newline, and fvwm2 isn't parsing it out, so it tries to start a command
>  named "fvwm2\n".

>  Would it break anything if restart_function() were changed to parse out
>  the first word after the command?

        I wouldn't recommend changing the restart function to compensate for
a bug in the FvwmButtons interface (if that were the case): that would be 
degrading code that's working nicely instead of fixing what's broken.

        However, I think that if you try something along the following lines 
you'll be more than satisfied with the result:

       *FvwmButtons(Title Restart, Icon icon.xpm, Action "Restart fvwm2")

or whatever your Favorite Virtuous Window Manager is called.

        Cheers,
        Bob
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Astoorian <[email-masked]>
Date: Thu, 21 Aug 1997 23:16:17 -0400

>degrading code that's working nicely instead of fixing what's broken.

Well, I still think it's a bug, if for no other reason than that its
behaviour seems inconsistent with the way other FVWM commands work; for
example,
    Restart twm

works, while
    Restart "twm"

tries to run an executable with quotes in its name.  Moreover, I can't
think of any practical case where *not* parsing produces more desirable
behaviour than parsing (ask yourself: is it *reasonable* for fvwm2 to
try to exec command names with embedded newlines, spaces, or quotes?)

Granted, modules probably shouldn't be sending commands with newlines
embedded in them, and it's not specifically documented what fvwm2 should
do when that happens.  Personally, I think it would be a good thing in
theory if packets from modules were treated as small .fvwm2rc files;
this would allow multiple commands to be sent in a single packet by
separating them with newlines.  However, I haven't looked into how much
effort it would take to implement this.

Anyways, just my $0.02.

>       *FvwmButtons(Title Restart, Icon icon.xpm, Action "Restart fvwm2")

Thanks for the workaround.  (In case it's not obvious, my configuration
for FvwmButtons was derived from my configuration for fvwm-1.24's
GoodStuff module, before this syntax was introduced.)

--                          People shouldn't think that it's better to have
Dan Astoorian               loved and lost than never loved at all.  It's
http://www.utopia.csas.com  not, it's better to have loved and won.  All
[email-masked]       the other options really suck.    --Dan Redican