summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index a35a2060b9..e4694bcfb6 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1003,8 +1003,13 @@ PP(pp_select)
}
if (newdefout) {
- if (!GvIO(newdefout))
- gv_IOadd(newdefout);
+ if (!GvIO(newdefout)) {
+ if (ckWARN(WARN_UNOPENED))
+ warner(WARN_UNOPENED, "select() on unopened file");
+ if (SvTYPE(newdefout) != SVt_PVGV)
+ RETURN;
+ gv_IOadd(newdefout); /* XXX probably bogus */
+ }
setdefout(newdefout);
}