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:
parent
5707f9a19b
commit
1074cc24d5
@ -39,6 +39,11 @@ convert_encoding(const char * from, const char * to,
|
|||||||
do {
|
do {
|
||||||
size_t nonReversibleConversions = iconv(conversion,inputBuffer,&inputLeft,&dst,&outputLeft);
|
size_t nonReversibleConversions = iconv(conversion,inputBuffer,&inputLeft,&dst,&outputLeft);
|
||||||
if (nonReversibleConversions == (size_t)-1) {
|
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) {
|
switch (errno) {
|
||||||
case EILSEQ: // unable to generate a corresponding character
|
case EILSEQ: // unable to generate a corresponding character
|
||||||
{
|
{
|
||||||
@ -71,9 +76,6 @@ convert_encoding(const char * from, const char * to,
|
|||||||
inputBuffer++;
|
inputBuffer++;
|
||||||
inputLeft--;
|
inputLeft--;
|
||||||
break;
|
break;
|
||||||
case E2BIG:
|
|
||||||
// not enough room in the output buffer for the next converted character
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
// unknown error, completely bail
|
// unknown error, completely bail
|
||||||
status = errno;
|
status = errno;
|
||||||
|
Loading…
Reference in New Issue
Block a user