Re: Bug in crm114 parser? Or is it me again?

Paolo <[email protected]>
Newsgroups gmane.mail.spam.crm114
Message-ID <20080522205923.GE2534@localhost>
On Thu, May 22, 2008 at 04:02:24PM -0400, Bill Yerazunis wrote:
> 
> Something is seriously wrong; I get:

indeed ...

> from:
> 
>   match [:spam:] (:: :spamdir: :spamwildcard:) /^(.*[\\\/])([^\\\/]*)/
> 
> to:
> 
>   match [:spam:] (:: :spamdir: :spamwildcard:) /^(.*[\/\\])([^\/\\]*)/
> 
> which _should_ be identical in behavior, but they aren't, because

... problem is likely that we look for next '\' but we don't count how
many we've seen. Note that if you try from that as an in-line from cmd line
you get crazy before getting it right. A workaround is to use [\o134\o057].


> the first one gets an error and the second one works, yielding:
> 
>   # crm ger.crm 
>   spam source: /dir1/dir2/dir3/ --  -- /dir1/dir2/dir3/
>   OK 1
>   spam source: /dir1/dir2/dir3/* -- * -- /dir1/dir2/dir3/*
>   OK 2
>   #
> 
> which is very counterintuitive, and almost *certainly* means we've
> got a subtle bug in backslash expansion.

yeah, but the result - :spamdir: changes as well - is probably correct: 
the 1st () takes all, the 2nd binds to the null string at the end, which
belongs to 1st () as well, imo.
An option is to add 

 { 
   match <absent> [:spamwildcard:] /./
+  isolate (:spamdir:)
   alter (:spamwildcard:) /*/
 }

Note that last MATCH is wrong, if I got its purpose right:

- match [:spamdir:] /\/dir1\/dir2\/dir3\/*/
+ match [:spamdir:] /\/dir1\/dir2\/dir3\/\*/


-- 
paolo

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.