W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1997

Alternate SGML.c module in wwwlib 5.0a...?

From: Markku Savela <msa@msa.tte.vtt.fi>
Date: Wed, 12 Feb 1997 15:53:25 +0200 (EET)
Message-Id: <199702121353.PAA13153@msa.tte.vtt.fi>
To: www-lib@w3.org
cc: msa@msa.tte.vtt.fi
More shameful bugs found from my own code. I was plagued by some rare
funny appearances of '<' into the content of the pages, and I have now
traced it into occurrence of a buffer break after NL code. The state
S_nl handled it wrong (all caused by my changes to get longer 'chunks'
output of the SGML stream). This bug is not in the original wwwlib
SGML.c, so anyone using that can ignore this..



*** SGML.c~	Wed Feb 12 14:52:14 1997
--- SGML.c	Wed Feb 12 15:16:34 1997
***************
*** 367,375 ****
  					(context->contents == SGML_LITERAL) ?
  						S_literal : S_nl_tago;
  			    }
! 			else
  			    {
  				++count;
  				goto S_text;
  			    }
  			break;
--- 367,392 ----
  					(context->contents == SGML_LITERAL) ?
  						S_literal : S_nl_tago;
  			    }
! 			/*
! 			** The following is a bit tricky/complex, but the
! 			** goal is to keep the contiguous text runs as long
! 			** as possible, and the following tries to avoid a
! 			** need to break after every NL! The first condition
! 			** verifies that there was no buffer break after NL,
! 			** and thus the run can simple be extended --msa.
! 			*/
! 			else if (text != b - 1)
  			    {
  				++count;
+ 				goto S_text;
+ 			    }
+ 			else
+ 			    {
+ 				/* NL code was in the previous buffer! Cannot
+ 				   extend the text run to cover it. Ouput
+ 				   explicitly (count == 0!).
+ 				   */
+ 				PUTC('\n');
  				goto S_text;
  			    }
  			break;


--
Markku Savela (msa@hemuli.tte.vtt.fi),     Technical Research Centre of Finland
Multimedia Systems, P.O.Box 1203,FIN-02044 VTT,http://www.vtt.fi/tte/staff/msa/
Received on Wednesday, 12 February 1997 10:06:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:27 GMT