diff options
author | Leon Timmermans <fawaka@gmail.com> | 2011-01-24 16:48:02 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2011-01-27 12:21:12 +0100 |
commit | 82505891db31e111f883f34516330c3d94c70486 (patch) | |
tree | d3111196e0850e97e1058a14973d5835c33db865 /ext/PerlIO-scalar | |
parent | cfc889ad29c3a0868d6182fddbe612d7f51d6b11 (diff) | |
download | perl-82505891db31e111f883f34516330c3d94c70486.tar.gz |
Made binmode $fh, ':scalar' DWIM
This silences this warning:
$ perl -we 'open my $f, ">", \my $x; binmode $f, "scalar"'
Use of uninitialized value in binmode at -e line 1.
Diffstat (limited to 'ext/PerlIO-scalar')
-rw-r--r-- | ext/PerlIO-scalar/scalar.xs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/PerlIO-scalar/scalar.xs b/ext/PerlIO-scalar/scalar.xs index e081c17f50..b6cc5c1bb7 100644 --- 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)) |