because PerlIOScalar_unread was broken.
Bump version number of PerlIO::scalar to 0.04.
p4raw-id: //depot/perl@24543
package PerlIO::scalar;
-our $VERSION = '0.03';
+our $VERSION = '0.04';
use XSLoader ();
XSLoader::load 'PerlIO::scalar';
1;
{
PerlIOScalar *s = PerlIOSelf(f, PerlIOScalar);
char *dst = SvGROW(s->var, (STRLEN)s->posn + count);
+ s->posn -= count;
Move(vbuf, dst + s->posn, count, char);
- s->posn += count;
- SvCUR_set(s->var, (STRLEN)s->posn);
SvPOK_on(s->var);
return count;
}
}
$| = 1;
-print "1..26\n";
+print "1..27\n";
my $fh;
my $var = "ok 2\n";
open(MEM, '<', \$data) or die "Fail: $!\n";
my $x = join '', <MEM>;
print $x eq '' ? "ok 26\n" : "not ok 26\n";
+
+{
+ # [perl #35929] verify that works with $/ (i.e. test PerlIOScalar_unread)
+ my $s = <<'EOF';
+line A
+line B
+a third line
+EOF
+ open(F, '<', \$s) or die "Could not open string as a file";
+ local $/ = "";
+ my $ln = <F>;
+ close F;
+ print $ln eq $s ? "ok 27\n" : "not ok 27\n";
+}