Subject: CopyToken()

From: Scott Smedley <[email-masked]>
Date: Tue, 12 Oct 2004 13:29:15 +1000

Hi Dominik, :)

After revision 1.61 of libs/Parse.c, DoPeekToken() is behaving very
oddly. Best illustrated with an example:

If I pass a string, say, "2.5.13" to DoPeekToken() with delimiters ".",
I get back the token "2" (correct) but the pointer to the rest of the
string (the actual return value) is ".13" which is incorrect. (The '5'
character got truncated in CopyToken().)

+   t = SkipSpaces(src, spaces, snum);
+   if (*t != 0 && dnum && strchr(delims, *t) != NULL)
+   {
+       src = t + 1;
+   }

I think the strchr() needs to be replaced with a function that
checks for delims at the _start_ of t (not just anywhere in t).
But I'm not really sure what your intention was, hence why I'll
leave it to you to fix.

I noticed this problem because the following syntax no longer works:

Test (Version >= 2.5.11) Echo yup

Seeya!

SCoTT. :)
--
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: Tue, 12 Oct 2004 11:37:00 +0200

> checks for delims at the _start_ of t (not just anywhere in t).

strchr(delims, *t) looks for the character *t in the string
delims, not vice versa.

> But I'm not really sure what your intention was, hence why I'll

The intention was to skip the delimiter that ended the token, even
if it is preceded by spaces.  I missed the case that there is no
whitespace *after* the delimiter, though.  Fixed.

> Test (Version >= 2.5.11) Echo yup

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]