Re: About problems with wml
On Mon, Aug 28, 2000 at 05:24:57AM -0600, Anthony Fok wrote:
> Hello Denis!
>
> On Mon, Aug 28, 2000 at 07:22:53AM +0200, Denis Barbier wrote:
> > > Yes, I just noticed that Josip has already uploaded it to Incoming.
> > > Unfortunately, it still has some troubles. While mp4h won't stop like
> > > it did in 1.0.2, it has filtered out the 0xB3 character on the Chinese
> > > pages on the Debian website when I tested it on my computer. Not sure
> > > why 0xB3. I just took a look on the mangled Chinese characters and see
> > > what is missing, and it seems 0xB3 is the only one missing for now.
> >
> > Hi Anthony,
> >
> > This is a nasty bug, it disappears when compiling with --with-dmalloc.
>
> Is it a small bug in the mp4h code, or is it a bug with the C library?
It was mine, as i always have thought. The attached patch fixes the problem.
I will try to find time tomorrow to provide a more elegant fix, and if
so release mp4h-1.1.1. I will have a very good sleep tonight ;-)
Denis
--- mp4h-1.1.0.orig/src/output.c 2000/07/04 20:12:09 1.18
+++ mp4h-1.1.0/src/output.c 2000/08/29 23:23:52
@@ -289,7 +289,7 @@
After that, string is shifyed. */
if (restore_quotes)
{
- for (cp=s; *cp != '\0' && !(IS_GROUP (*cp)); cp++)
+ for (cp=s; *cp != '\0' && !(IS_GROUP ((unsigned char) *cp)); cp++)
{
if (*cp == CHAR_QUOTE)
*cp = '"';
@@ -297,7 +297,7 @@
}
else
{
- for (cp=s; *cp != '\0' && !(IS_GROUP (*cp)); cp++)
+ for (cp=s; *cp != '\0' && !(IS_GROUP ((unsigned char) *cp)); cp++)
;
}
@@ -306,7 +306,7 @@
for ( ; *cp != '\0'; cp++)
{
- if (IS_GROUP (*cp))
+ if (IS_GROUP ((unsigned char) *cp))
offset++;
else if ((*cp == CHAR_QUOTE) && restore_quotes)
*(cp-offset) = '"';
@@ -322,10 +322,10 @@
`----------------------------------------------------*/
static void
-remove_stars_and_slash (char *s)
+remove_stars_and_slash (unsigned char *s)
{
int offset;
- register char *cp;
+ register unsigned char *cp;
offset = 0;
cp = s;
@@ -480,7 +480,7 @@
and trailing slash in attributes */
if (!(exp_flags & (EXP_LEAVE_TRAILING_STAR | EXP_LEAVE_TRAILING_STAR))
|| (exp_flags & EXP_REMOVE_TRAILING_SLASH))
- remove_stars_and_slash (text);
+ remove_stars_and_slash ((unsigned char *)text);
if (*text == '\0')
{
Reply to: