}
}
- if (!charstart) {
+ if (charcount < recsize) {
/* read the rest of the current character, and maybe the
beginning of the next, if we need it */
- STRLEN readsize = skip - (bend - bufp) + (charcount + 1 < recsize);
+ STRLEN readsize = (charstart ? 0 : skip - (bend - bufp))
+ + (charcount + 1 < recsize);
STRLEN bufp_offset = bufp - buffer;
SSize_t morebytesread;
no utf8; # needed for use utf8 not griping about the raw octets
-plan(tests => 58);
+plan(tests => 59);
$| = 1;
open F, ">:utf8", $a_file;
print F "foo\xE4";
print F "bar\xFE";
+ print F "a\xE4a";
close F;
open F, "<:utf8", $a_file;
local $/ = \4;
is($line, "foo\xE4", "readline with \$/ = \\4");
$line .= <F>;
is($line, "foo\xE4bar\xFE", "rcatline with \$/ = \\4");
+ $line = <F>;
+ is($line, "a\xE4a", "readline with boundary condition");
close F;
# badly encoded at EOF