Marek Rouchal DAT CAD HW Tel 25849 <[EMAIL PROTECTED]> writes:

> Hello Gisle,
> 
> I just downloaded this module from CPAN and tested it - I get the
> following error in the tests:
> 
> t/parser............Assertion failed: file "./hparser.c", line 243 at
> t/parser.t line 139.
> 
> The line is
> 
> assert(len < 2 || *beg != beg[len-1]);

This assertion is simply backwards.  Assertions are automatically
enabled if your perl is compiled with -DDEBUGGING, and I guess we
never tried that.  This is the patch that will be in 3.01:

Index: hparser.c
===================================================================
RCS file: /home/cvs/aas/perl/mods/html-parser/hparser.c,v
retrieving revision 2.30
retrieving revision 2.31
diff -u -p -u -r2.30 -r2.31
--- hparser.c   1999/12/14 09:40:13     2.30
+++ hparser.c   1999/12/15 20:56:37     2.31
@@ -240,7 +240,7 @@ report_event(PSTATE* p_state,
            char *beg = tokens[i+1].beg;
            STRLEN len = tokens[i+1].end - beg;
            if (*beg == '"' || *beg == '\'') {
-             assert(len < 2 || *beg != beg[len-1]);
+             assert(len >= 2 && *beg == beg[len-1]);
              beg++; len -= 2;
            }
            attrval = newSVpvn(beg, len);

Regards,
Gisle

Reply via email to