summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-04-19 01:17:44 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-19 13:15:22 +0000
commit9a869a144b8c08cf3747874fbb8bd8b4e7a0c4ef (patch)
tree1a732c2ee56f71bd6a598fc46b76ba1f0cf3ea5b /doio.c
parent88bf1d0c841cfc277f8a00d92af6a0d37a1625d7 (diff)
downloadperl-9a869a144b8c08cf3747874fbb8bd8b4e7a0c4ef.tar.gz
warn on ref open without perlio
Message-ID: <20020418231744.A24159@rafael> (with one nit, the skip message needed "# " prefix) p4raw-id: //depot/perl@16004
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/doio.c b/doio.c
index 1495ff58de..d362cb9c4c 100644
--- a/doio.c
+++ b/doio.c
@@ -213,6 +213,15 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
if (num_svs) {
/* New style explict name, type is just mode and discipline/layer info */
STRLEN l = 0;
+#ifdef USE_STDIO
+ if (SvROK(*svp) && !strchr(name,'&')) {
+ if (ckWARN(WARN_IO))
+ Perl_warner(aTHX_ packWARN(WARN_IO),
+ "Can't open a reference");
+ SETERRNO(EINVAL, LIB$_INVARG);
+ goto say_false;
+ }
+#endif /* USE_STDIO */
name = SvOK(*svp) ? SvPV(*svp, l) : "";
len = (I32)l;
name = savepvn(name, len);