[elinks-users] Re: [BUG/PATCH] ELusive misparsing of quoted strings

Martin Zwickel martin.zwickel at technotrend.de
Tue Jul 22 23:25:24 PDT 2003


On Wed, 23 Jul 2003 04:31:49 +0200
Petr Baudis <pasky at ucw.cz> bubbled:

> Dear diary, on Tue, Apr 22, 2003 at 09:42:19AM CEST, I got a letter,
> where Martin Zwickel <martin.zwickel at technotrend.de> told me, that...
> > Hi there!
> 
> Hi,
> 
> > the tag:
> > <a href="e" onmouseover="document.title='hast mich!';">hallo2</a>
> > doesn't work with ELusive's html parser.
> > 
> > the patch:
> > --- a/elusive/parser/html/parser.c    2003-04-09 13:03:39.000000000 +0200
> > +++ b/elusive/parser/html/parser.c    2003-04-17 10:24:33.000000000 +0200
> > @@ -494,8 +485,17 @@
> >         attr = html, attr_len = html_len;
> >  
> >         while (html_len) {
> > -               if ((!WHITECHAR(*html) && *html != '>')
> > -                   && (!quoted || (quoted && *html != quoted))) {
> > +               if(quoted)
> > +               {
> > +                       if(*html!=quoted)
> > +                       {
> > +                               html++, html_len--;
> > +                               continue;
> > +                       }
> > +               }
> > +               else
> > +               if (!WHITECHAR(*html) && *html != '>')
> > +               {
> >                         html++, html_len--;
> >                         continue;
> >                 }
> 
> Even after staring at this for quite a long time, I can't see how is the new
> version non-equivalent to the old one. Could you please unblock me?
> 

hmm, strange patch ;) was long ago.
i know that there was a problem with the parsing and this patch fixed it.
i think it's the same as:

if ((!quoted && (!WHITECHAR(*html) && *html != '>'))
    || (quoted && (*html != quoted)))

so there is a little difference...

in the old behaviour:
if it was not quoted, it was ok, but if it's quoted,
it also has to be (!WHITECHAR(*html) && *html != '>'), because of the &&.
my patch removed the dep to this and it worked much better.

Regards,
Martin

-- 
MyExcuse:
Electrical conduits in machine room are melting.

Martin Zwickel <martin.zwickel at technotrend.de>
Research & Development

TechnoTrend AG <http://www.technotrend.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/elinks-users/attachments/20030723/a4f157e1/attachment.sig>


More information about the elinks-users mailing list