Subject: Bug with $0 etc.

From: Tim Phipps <[email-masked]>
Date: Wed, 10 Mar 1999 11:57:57 +0000

Hi all,
	I think I found the problem I was having with functions with args. 
I've commited a fix that works for me but I'd like you to look at it to
see if it's going to have side effects. In fvwm/functions.c
ComplexFunction2:

--- functions.c 1999/03/09 00:54:37     1.29
+++ functions.c 1999/03/10 11:52:37     1.30
@@ -739,7 +739,7 @@
   /* FindFunction expects a token, not just a quoted string */
   taction = GetNextToken(action,&func_name);
   if (func_name == NULL)
     return;
   func = FindFunction(func_name);
   free(func_name);
   if(func == NULL)
     {
       if(*desperate == 0)
         fvwm_msg(ERR,"ComplexFunction","No such function %s",action);
       return;
     }
   *desperate = 0;
   /* Get the argument list */
   for(i=0;i<10;i++)
-    action = GetNextToken(action,&arguments[i]);
+    taction = GetNextToken(taction,&arguments[i]);
   /* see functions.c to find out which functions need a window to
operate on */
   ev = eventp;

What this does is an extra GetNextToken before stashing the args.

Cheers,
Tim.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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, 10 Mar 1999 15:39:18 +0100

> see if it's going to have side effects. In fvwm/functions.c

I've already commited a fix. I don't think we need a second one ;-)

Bye

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.fvwm.org/>.
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: Tim Phipps <[email-masked]>
Date: Wed, 10 Mar 1999 16:48:45 +0000

> I've already commited a fix. I don't think we need a second one ;-)

If the fix you're thinking of is:

1999-03-09  Dominik Vogt  <[email-masked]>

        * fvwm/misc.h:
        * fvwm/menus.c (FindPopup):
        * fvwm/functions.c (ComplexFunction2):
        (FindFunction):
        Removed harmful GetNextToken from FindPopup and FindFunction.
This is
        done before these functions are called now. (Bug found by Julian
        Gilbey).

I think this is what broke $0.  My fix effectively puts back a
GetNextToken before the command line tokens are put into $0,$1...

Cheers,
Tim.

---

From: Julian Gilbey <[email-masked]>
Date: Wed, 10 Mar 1999 18:24:57 +0000 (GMT)

> GetNextToken before the command line tokens are put into $0,$1...

I haven't looked at the 2.3 sources yet (I'm still sorting out the
Debian side of 2.2), but I want to remind you of the problem that I
found, and why I had to remove the harmful GetNextToken: if the popup
menu name was something like "Window Ops", then the first GetNextToken
would return the name, viz: Window Ops.  If GetNextToken is called on
the result, then the returned value would (incorrectly) be Window.
This can cause all sorts of things to break later.  So whatever you
are suggesting, please check that it won't break on cases like these.
And again, I haven't yet started looking at 2.3, so I can't comment on
any specifics.

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. [email-masked]
             Debian GNU/Linux Developer.  [email-masked]
       -*- Finger [email-masked] for my PGP public key. -*-
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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: Thu, 11 Mar 1999 00:08:13 +0100

> GetNextToken before the command line tokens are put into $0,$1...

Nope. I just forgot to commit the patch, sorry. Actually your fix
is ever better.

Bye

Dominik

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]