Subject: Bugfixes (Windowlist, Parse.c) - new menu position patch

From: Dominik Vogt <[email-masked]>
Date: Wed, 07 Oct 1998 11:33:16 +0200

Hi all,

while implementing an enhancement to my menu position patch
that Tim requested I noticed that the do_windowlist function
in windows.c is *very* buggy and can cause buffer overflows.
While working on this I found more bugs in the library:

 - Enhancement: WindowList now accepts a double-click-action
   like 'Menu'. It must be the last parameter and be quoted if
   it is more than one word. It can remain empty though.
   The new syntax is:
     WindowList [position hints] [options] [double-click-action]
   --> nex feature

 - Enhancement: Double keypresses are ignored if no
   double-click-action has been defined. Otherwise the menu
   or WindowList would be closed without an action.
   --> enhanced feature

 - buffer overflows in do_windowlist (e.g. when 'Function'
   option is followed by a long function name (80 characters)).
   --> bug fixed

 - in Strings.c (in the library): StrEquals returns FALSE if
   both strings are empty. This might not matter, but if someone
   should ever rely on this it can give him a hard time
   debugging.
   --> bug fixed

 - the GetToken function in Parse.c (library) does not handle
   quotes or braces in a sensible way but returns rubbish. Since
   GetToken is rarely used (WindowList, once in Parse.c and three
   times in builtins.c) I removed all references to it and used
   GetNextToken instead and put '#if 0' araound it. This should
   either be fixed or removed completely.
   --> workaround for bug

 - memory leak in do_windowlist. The desk number after the 'Desk'
   option is copied into a malloced area but never freed again.
   --> bug fixed

 - If you bring up a root menu with a key and leave it with <left>
   the pointer is not warped back to where it started as it is if
   the menu is closed with <esc>.
   --> bug fixed

Ciao

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
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: Dominik Vogt <[email-masked]>
Date: Wed, 07 Oct 1998 11:43:05 +0200

Here is the missing patch.

---

From: Brad Giaccio <[email-masked]>
Date: Wed, 7 Oct 1998 08:50:18 -0400 (EDT)

Dominik,
 Just a question is there any reason that you are not using the CVS
mechanisms for your menu patches.  Now don't get me wrong I've been trying
them out and like them.  But I was just wondering on the distribution
method.

Brad

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous

---

From: Tim Phipps <[email-masked]>
Date: Thu, 08 Oct 1998 16:25:46 +0100

> Here is the missing patch.
------------------------------------------------------------------------
> 
>                    Name: mp3pat.gz
>    mp3pat.gz       Type: application/x-gzip
>                Encoding: base64

Something is wrong here.  I have the following in my .fvwm2rc: 

GlobalOpts SmartPlacementIsReallySmart

with this patch I get:

[FVWM][GlobalOpts]: <<ERROR>> Unknown Global Option ''
[FVWM][GlobalOpts]: <<ERROR>> Unknown Global Option ''
[FVWM][GlobalOpts]: <<ERROR>> Unknown Global Option ''
[FVWM][GlobalOpts]: <<ERROR>> Unknown Global Option ''
[FVWM][GlobalOpts]: <<ERROR>> Unknown Global Option ''
[FVWM][GlobalOpts]: <<ERROR>> Unknown Global Option ''
[FVWM][GlobalOpts]: <<ERROR>> Unknown Global Option ''
 in my log file.  It doesn't stop until I kill it.  It looks like
something in the parsing is retuning an error and GlobalOpts is looping.

Cheers,
Tim.

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 09 Oct 1998 15:47:08 +0200

> Something is wrong here.  I have the following in my .fvwm2rc:

OK, here is a patch to a clean 2.0.47d (builtins.c ONLY).
Apply it to a fresh builtins.c and copy the result over
the builtins.c from my previous patch.

Ciao

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883,
[email-masked]