[Buttress-authors] Text lost after XHTML entities

James Aylett james@tartarus.org
Mon, 16 Jul 2001 08:57:29 +0100


On Thu, Jul 12, 2001 at 02:28:42PM +0100, Christian Ludlam wrote:

> This is a very quick patch which fixes a bug causing everything after an
> entity to be lost. I may be working from very old source, so if this is
> already done, ignore me.

A better patch (and applied):

----------------------------------------------------------------------
Index: bk_xhtml.c
===================================================================
RCS file: /usr/data/cvs/buttress/bk_xhtml.c,v
retrieving revision 1.6
diff -p -u -r1.6 bk_xhtml.c
--- bk_xhtml.c	2001/01/27 15:42:23	1.6
+++ bk_xhtml.c	2001/07/16 07:55:34
@@ -1131,8 +1131,8 @@ static int xhtml_convert(wchar_t *s, cha
 		plen+=6;
 	      } else {
 		/* FIXME: entity names! */
-		ensure_size(plen+7); /* includes space for the NUL, which is subsequently stomped on */
-		plen+=sprintf(p+plen, "&#%i;", (int)c);
+		ensure_size(plen+8); /* includes space for the NUL, which is subsequently stomped on */
+		plen+=sprintf(p+plen, "&#%04i;", (int)c);
 	      }
 	    }
 	}
----------------------------------------------------------------------

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                           www.zap.uk.eu.org
  james@tartarus.org                                    www.footlights.org