According to Torsten Neuer:
> Gilles Detillieux wrote:
> >
> > --- htdig/SGMLEntities.cc.orig Wed Sep 22 11:18:41 1999
> > +++ htdig/SGMLEntities.cc Thu Oct 14 15:08:31 1999
> > @@ -280,5 +280,11 @@ SGMLEntities::translateAndUpdate(unsigne
> >
> > if (*entityStart == ';')
> > entityStart++; // A final ';' is used up.
> > - return translate(entity);
> > + unsigned char e = translate(entity);
> > + if (e == ' ' && strncmp((char *)orig, " ", 4) != 0)
> > + {
> > + entityStart = orig + 1; // Catch unrecognized entities...
> > + return '&';
> > + }
> > + return e;
> > }
>
> Thanks for the improvements, but shouldn't the test for the space
> character include and   as well?
No, because and   both return a non-breaking space character
(160), not a regular space character (32 or ' '). The point of that test
is that if translate() returns a space character, you need to determine
if it did so because of an unrecognised entity, or because of the one
legitimate entity that translates to a space. If it returns 160, you
know it's legitimate, and 160 != ' ', so (e == ' ') will be false.
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
------------------------------------
To unsubscribe from the htdig mailing list, send a message to
[EMAIL PROTECTED] containing the single word unsubscribe in
the SUBJECT of the message.