This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cfc889a
)
Made binmode $fh, ':scalar' DWIM
author
Leon Timmermans
<fawaka@gmail.com>
Mon, 24 Jan 2011 15:48:02 +0000
(16:48 +0100)
committer
Rafael Garcia-Suarez
<rgs@consttype.org>
Thu, 27 Jan 2011 11:21:12 +0000
(12:21 +0100)
This silences this warning:
$ perl -we 'open my $f, ">", \my $x; binmode $f, "scalar"'
Use of uninitialized value in binmode at -e line 1.
ext/PerlIO-scalar/scalar.xs
patch
|
blob
|
blame
|
history
diff --git
a/ext/PerlIO-scalar/scalar.xs
b/ext/PerlIO-scalar/scalar.xs
index
e081c17
..
b6cc5c1
100644
(file)
--- a/
ext/PerlIO-scalar/scalar.xs
+++ b/
ext/PerlIO-scalar/scalar.xs
@@
-22,7
+22,7
@@
PerlIOScalar_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg,
* using, otherwise arg (from binmode presumably) is either NULL
* or the _name_ of the scalar
*/
- if (arg) {
+ if (arg
&& SvOK(arg)
) {
if (SvROK(arg)) {
if (SvREADONLY(SvRV(arg)) && mode && *mode != 'r') {
if (ckWARN(WARN_LAYER))