[BUG+FIX] Problem in parser.TrimInitialSpace

This routine does not check to see if the space it's trimming is
actually part of the node from which it's trimming the space.  This
results in a situation where node.start is greater than node.end.  This
causes negative subscript errors in clone() and other bad things.

To fix:

Change line 326 from:

    if (text->type == TextNode && lexer->lexbuf[text->start] == ' ')

to:

    if (text->type == TextNode && lexer->lexbug[text->start] == ' '
                               && text->start < text->end)

Gary

Received on Tuesday, 31 October 2000 18:47:09 UTC