fix stupid looping bug on large files - thanks kuye, Tim

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5823 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2003-12-30 11:09:44 +00:00
parent 5707f9a19b
commit 1074cc24d5

View File

@ -39,6 +39,11 @@ convert_encoding(const char * from, const char * to,
do {
size_t nonReversibleConversions = iconv(conversion,inputBuffer,&inputLeft,&dst,&outputLeft);
if (nonReversibleConversions == (size_t)-1) {
if (errno == E2BIG) {
// Not enough room in the output buffer for the next converted character
// This is not a "real" error, we just quit out.
break;
}
switch (errno) {
case EILSEQ: // unable to generate a corresponding character
{
@ -71,9 +76,6 @@ convert_encoding(const char * from, const char * to,
inputBuffer++;
inputLeft--;
break;
case E2BIG:
// not enough room in the output buffer for the next converted character
break;
default:
// unknown error, completely bail
status = errno;