projects
/
p5sagit/p5-mst-13.2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Allow clobbering of a PerlIO::Scalar and more tests
[p5sagit/p5-mst-13.2.git]
/
ext
/
PerlIO
/
Scalar
/
Scalar.xs
diff --git
a/ext/PerlIO/Scalar/Scalar.xs
b/ext/PerlIO/Scalar/Scalar.xs
index
9e9412a
..
a4203bf
100644
(file)
--- a/
ext/PerlIO/Scalar/Scalar.xs
+++ b/
ext/PerlIO/Scalar/Scalar.xs
@@
-44,6
+44,8
@@
PerlIOScalar_pushed(PerlIO *f, const char *mode, SV *arg)
s->posn = SvCUR(SvRV(arg));
else
s->posn = 0;
+ if ((PerlIOBase(f)->flags) & PERLIO_F_TRUNCATE)
+ SvCUR(SvRV(arg)) = 0;
return code;
}