Re: more bug fixes
Jose Da Silva <[email protected]>
| Newsgroups | gmane.comp.fonts.fontforge.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Martin, On October 14, 2013 06:40:11 PM Martin Hosken wrote: > OK. But the code that is currently in there for UTF7 doesn't work. It > always returns an empty string. This is because you never create a > buffer. Since in the first pass through, pt is NULL, the pt && > pt+10>=end doesn't pass and so buffer isn't created and pt remains 0. > If no pt, then no call to utf8_idpb and a quick exit. I think my patch > does what you want in this respect in that the first time through it > will create a buffer, then if pt is set to 0 by utf8_ipdb then it will > pass through the inside ifs with no changes. > > > This routine 'above' really needs to be checked from top to bottom to > > verify all if-then-else do what's expected. > > The (pt && pt+10>=end) was just a 'quick' check for the possibility of > > if pt becomes zero if utf8_idpb returns zero on error. > > Agreed. If I were to do it, I would probably rewrite. It looks ugly as > sin, but that may just be the nature of the problem. Anyway, I suggest > that my patch fixes both of our problems. You'll notice most of my recent patching at the moment is dancing around UTF8 approximately around Unicode/ustring.c at the moment (which was all brought about due to a static scan flagging of ch<0), so looking at patching the UTF7 routines isn't even in my focus yet (except for the brief mending of utf8_idpb() with the extended flags in the code above, plus other routines that also call utf8_idpb() ). Meanwhile, I note Ben is more-or- less going around collab and other locations, which means the UTF7 code here is unattended and could use a more careful look/try/test/verify/etc. :-) Would you be interested in giving this a poke and trying to fix this? Do you think some of the lower-level UTF8 patching I'm looking at now is of benefit to this higher-up routine? > BTW, the first patch in my first message on this thread is the key patch > that needs to be applied (and I don't see it in the repo yet) My excuse is... Thanksgiving weekend (in Canada) and my focus was on other things like family, friends, and dinner - not on FontForge ;-) > which > fixes the segfault that can occur if you try to draw a curve that > doesn't start with an on curve point. Thanks! Joe ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk