Dnia 30-05-2007, śro o godzinie 14:41 +0200, Alexandre Julliard pisze:
Robert Shearman rob@codeweavers.com writes:
Hi, I found this patch from May 2007 which never got into wine. http://www.winehq.org/pipermail/wine-patches/2007-May/039722.html
Could you explain me what is still wrong with it? I would like to fix it.
p++;
if ((*p == 'X') || (*p == 'x'))
{
/* hexadecimal entity */
while ((*p >= '0' && *p <= '9') || (*p >= 'a' && *p
<= 'f') ||
(*p >= 'A' && *p <= 'F'))
p++;
ch = strtolW(start + 2, NULL, 16);
}
This is still broken.
You said earlier: "You should exit the loop at the first ';'. Also you have to increment p first."
It looks like Robert did what you said?
if (p - start - 1 <= sizeof(char_refs[0].name))
{
for (i = 0; i <
sizeof(char_refs)/sizeof(char_refs[0]); i++)
if (!strncmpW(char_refs[i].name, start + 1, p -
start - 1))
break;
}
This is still broken too.
You said earlier: "The sizeof check doesn't make much sense, especially inside the loop. What you need is to check that you reached the end of the string if the strncmpW succeeded."
You mean to check if *p == 0 ?
While reading this patch I found another bug:
+ if (i == sizeof(char_refs)/sizeof(char_refs[0])) + { + FIXME("character entity %s not found\n", debugstr_wn(start + 1, p - start - 1)); + continue; + }
I think *start should be changed to another char in that case, because if we will not change it, we will fall into infinite loop like it happens with help file in GPSTRACK from bug #6801.
Moreover we need full entity table, one of those mentioned by Hin-Tak Leung: http://bugs.winehq.org/show_bug.cgi?id=6801#c28
--- On Tue, 15/4/08, Tomasz Jezierski - Tefnet developers@tefnet.pl wrote: <snipped>
While reading this patch I found another bug:
if (i ==
sizeof(char_refs)/sizeof(char_refs[0]))
{
FIXME("character entity %s not
found\n", debugstr_wn(start + 1, p - start - 1));
continue;
}
I think *start should be changed to another char in that case, because if we will not change it, we will fall into infinite loop like it happens with help file in GPSTRACK from bug #6801.
I have experience the infinite loop myself, but I haven't quite checked where it is - it happens if the table is incomplete and the code encounters an html entity that's not mentioned in the table. I encountered it when I tried to view some help pages containing german ¨aute; 's in another help file I happened to have around. (gpstrack is about french accented characters.)
So in that sense, the patch is dangerous - infinite loop is far worse than not seeing a couple of help pages. I think it needs to do something sensible (e.g. don't translate) even if the table is incomplete.
___________________________________________________________ Yahoo! For Good helps you make a difference
Dnia 16-04-2008, śro o godzinie 00:49 +0000, Hin-Tak Leung pisze:
--- On Tue, 15/4/08, Tomasz Jezierski - Tefnet developers@tefnet.pl wrote:
<snipped> > While reading this patch I found another bug: > > + if (i == > sizeof(char_refs)/sizeof(char_refs[0])) > + { > + FIXME("character entity %s not > found\n", > debugstr_wn(start + 1, p - start - 1)); > + continue; > + } > > I think *start should be changed to another char in that > case, because > if we will not change it, we will fall into infinite loop > like it > happens with help file in GPSTRACK from bug #6801.
I have experience the infinite loop myself, but I haven't quite checked where it is - it happens if the table is incomplete and the code encounters an html entity that's not mentioned in the table. I encountered it when I tried to view some help pages containing german ¨aute; 's in another help file I happened to have around. (gpstrack is about french accented characters.)
If you won't find entity in table and change ampersand to another char, you won't get infinite loop, but I'm not sure what will happen if you have & in help, that might trigger loop too. Do you know any free software in which I can craft such chm files?
--- On Wed, 16/4/08, Tomasz Jezierski - Tefnet developers@tefnet.pl wrote:
<snipped>
If you won't find entity in table and change ampersand to another char, you won't get infinite loop, but I'm not sure what will happen if you have & in help, that might trigger loop too. Do you know any free software in which I can craft such chm files?
I don't know about "free", but the microsoft htmlhelp workshop is available for download... and you might be able to do something like that with it.
It is also a good source of information, BTW. Comes with an htmlhelp API reference. (I installed it under wine last week).
BTW, I keep forgetting - what is the policy about contributing code after reading MSDN and official microsoft documentation available for download such as this?
I think MSDN is okay, butactual source files (including include headers) is not?
___________________________________________________________ Yahoo! For Good helps you make a difference