[antispam-f] Re: Antispam and RegEx

  • From: Martin <freelists@xxxxxxxxxxxxxxxx>
  • To: antispam@xxxxxxxxxxxxx
  • Date: Tue, 07 Nov 2006 23:17:31 +0000 (GMT)

In article <4e82288071steve.pampling@xxxxxxxxxxxxx>,
   Steven Pampling <steve.pampling@xxxxxxxxxxxxx> wrote:
> On 07 Nov, Martin <freelists@xxxxxxxxxxxxxxxx> wrote:

> > The problem is when an expression is first longer then 128
> > characters. Some storage is expanded and moved, but a pointer within
> > it is NOT moved. This means that writes are to the wrong place
> > (nasty) and the subsequent read only sees the first 128 bytes and
> > then rubbish, often leading to 'Invalid Range end' Compile errors
> > which helpfully disappear when you try it again.

> A work around is to compile the pattern as 255 characters right at the
> start, thereafter the storage used is constant. (As far as I could tell
> - when I was playing with the module sometime back I don't think the
> rather useful Reporter was a functional as it is today)

I did consider that for my fix, but decided that the space could double
again, if you had a large enough expression after expansion. So as the
fix I added which seems to work is only one extra statement anyway, I
thought that would be better. 

Mind you, I could be wrong, as I have never really looked at a C program
before! As a language it may be very powerful, but it certainly does some
things which are ... ummm ... not obvious.  At least to me. 

Martin

-- 
Martin Avison      using a British Iyonix running RISC OS 5 
                   and the Pluto mail and newsreader

Other related posts: