lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LYNX-DEV Comment parsing bug in lynx, and fix.


From: Brian Borowski
Subject: LYNX-DEV Comment parsing bug in lynx, and fix.
Date: Mon, 18 Nov 96 13:28 EST

To whom it may concern:

I have found a bug (sort-of) in lynx's comment parsing code.
For us blind people here, (like myself) we find lynx important and useful,
and we couldn't figure out why some html was not being rendered at all.
The problem was, after I did some checking around, that the comments in some
people's pages consisted of  things like,
<!--------------->
Where there was a '<!--' followed by no blanks.  Lynx was
not finding this, and seemed to be missing chunks of the document.

I noted, that in 'HTML.c' you were doing a strncmp(data, "<!--", 4), and
then calling  LYFindEndOfComment after that.
In 'LYFindEndOfComment' you were doing a strcmp(str, "<!--"),
and I have changed this to  '(strncmp(str, "<!--", 4) to be consistant and
also to find comments in strings that went on with no blanks.
The fix has done wonders, and I have included a patch to the file
'LYCharUtils.c' below.

I could have erred in this thing, but I don't think so.
Use patch to apply it.

Brian Borowski


--------patch-follows-----------------------patch-follows---------

*** LYCharUtils.c.orig  Mon Nov 18 12:26:23 1996
--- LYCharUtils.c       Mon Nov 18 12:30:18 1996
***************
*** 1024,1030 ****
         */
          return NULL;
  
!     if (strcmp(str, "<!--"))
          /*
         *  We don't have the start of a comment, so
         *  return the beginning of the string. - FM
--- 1024,1030 ----
         */
          return NULL;
  
!     if (strncmp(str, "<!--", 4))
          /*
         *  We don't have the start of a comment, so
         *  return the beginning of the string. - FM
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]