fix uncompression in bzip2 loader2

SVN revision: 13918
This commit is contained in:
Tilman Sauerbeck 2005-03-26 12:35:59 +00:00
parent 29b2ab1df7
commit f47e5e6b09
1 changed files with 4 additions and 4 deletions

View File

@ -30,13 +30,13 @@ static int uncompress_file (FILE *fp, int dest)
return 0;
}
error = BZ_OK;
while (error == BZ_OK) {
while (1) {
bytes = BZ2_bzRead (&error, bf, &outbuf, OUTBUF_SIZE);
if (error == BZ_OK)
if (error == BZ_OK || error == BZ_STREAM_END)
write (dest, outbuf, bytes);
else
break;
}
BZ2_bzReadClose (&error, bf);