u8-istream: Fix handling of partial reads.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 9 Sep 2014 15:51:44 +0000 (08:51 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 9 Sep 2014 15:51:44 +0000 (08:51 -0700)
The u8-istream code did not retry upon a partial read, assuming that that
was the end of the file.  When the partial read was shorter than
ENCODING_GUESS_MIN, this could cause the encoding guesser, in turn, to
guess the wrong encoding (especially if the encoding was really UTF-16 and
the partial read was an odd number of bytes).

Reported at https://bugs.debian.org/760841.
Reported by Friedrich Beckmann and Steven Chamberlain.


No differences found