Subject: Re: 2.0.47d: FvwmEvent is stripping the last char from config

From: Albrecht Kadlec <[email-masked]>
Date: 14 Dec 1998 20:41:59 +0100

Tim Phipps <[email-masked]> writes:

> Oops,
> 	Forget this, it seems to be a problem with FvwmTalk.  FvwmEvent works
> fine from config files.
> 
> Sorry all,
> Tim.
> 
> 
> Tim Phipps wrote:
> > 
> > Hi All,
> >         FvwmEvent seems to be stripping the las char from my config lines.  If
> > I try
> > 
> > *FvwmEventCmd Echo
> > *FvwmEvent focus_change focus
> > 
> > I get "No such module Ech" in the log file
> > 
> > If I use
> > 
> > *FvwmEventCmd EchoX
> > *FvwmEvent focus_change "focus changed"X
> > 
> > it works fine.
> > 
> > Cheers,
> > Tim.

well.
config lines from fvwm via pipe always have the \n at the end.
Maybe FvwmTalk doesn't add these.

-- 
Albrecht Kadlec
Vienna University of Technology / Department of Automation
----------------------------------------------------------
The wonderful thing about standards is that there are so many of them to 
choose from.                            -- Grace Murray Hopper
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Mon, 14 Dec 1998 16:21:33 -0500

> > 	Forget this, it seems to be a problem with FvwmTalk.  FvwmEvent works

No, you were right.  This was fixed in 2.1.X:

You need something like this:

  if (buf[strlen(buf)-1] == '\n') {     /* if line ends with newline */
    buf[strlen(buf)-1] = '\0';	/* strip off \n */
  }

The old logic assumed it could always replace the last character.

--
Dan Espen                                Phone: (732) 699-5570
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].