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

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 UTC