On Wednesday 26 Oct 2005 11:23, Emmanuel Saracco wrote:
> Yes it is. I've just created a new test file with 4 bars. I relabeled it
> with something like "[EMAIL PROTECTED]" and saved it. Then I closed 
> rosegarden, reopen
> it and load it. And it failed the way I explained in my previous E-Mail.

*sigh*

Well, the good news is that this time the problem is not in file saving.  The 
file itself is fine, it's loading it that's broken.

This looks like a consequence of our recent workaround for the KFilterDev hang 
when reading certain compressed files.

We now use KFilterDev::getch() to read the file.  This returns an int value.  
It's intended to return -1 for end of file; we actually test for anything < 0 
and treat that as end of file.

Unfortunately, getch() works by reading a char and casting that directly to an 
int.  Since char is signed by default, that means anything greater than 127 
comes through as a negative integer and is treated (by us) as end of file.  
It also means KFilterDev::getch() is basically hopeless as an API, because it 
gives you no way at all to distinguish between the byte 0xFF and end of file.

Fortunately for us and our ongoing series of hideous workarounds, 0xFF is 
never a valid character in UTF-8, so all we need to do is change our code so 
as only to treat -1 as EOF rather than any negative value.

"Fix" committed, and I'd just like to tediously repeat that this would never 
have happened if we'd stuck to using zlib directly like we used to.


Chris


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to