summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorDavid Dyck <david.dyck@fluke.com>2000-11-08 10:36:26 -0800
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-09 04:42:38 +0000
commit8a4e5b40dba3387613897ea9c275824694f125bc (patch)
tree01c369b90727005ac25a40a393ab51a3ff60c23c /pp_sys.c
parent826a9e1285c432ecea811e1c8c0049a6d9dbb82e (diff)
downloadperl-8a4e5b40dba3387613897ea9c275824694f125bc.tar.gz
patch to detect stat followed by lstat(_): [ID 20001106.006] find2perl generated scripts issue new lstat() on filehandle _ warning
Message-ID: <Pine.LNX.4.30.0011081817490.177-100000@dd.tc.fluke.com> p4raw-id: //depot/perl@7620
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 7a9dc3987a..4b8bfce2bd 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2557,9 +2557,15 @@ PP(pp_stat)
if (PL_op->op_flags & OPf_REF) {
gv = cGVOP_gv;
- if (PL_op->op_type == OP_LSTAT && ckWARN(WARN_IO) && gv != PL_defgv)
- Perl_warner(aTHX_ WARN_IO,
+ if (PL_op->op_type == OP_LSTAT) {
+ if (PL_laststype != OP_LSTAT)
+ Perl_croak(aTHX_ "The stat preceding lstat() wasn't an lstat");
+ if (ckWARN(WARN_IO) && gv != PL_defgv)
+ Perl_warner(aTHX_ WARN_IO,
"lstat() on filehandle %s", GvENAME(gv));
+ /* Perl_my_lstat (-l) croak's on filehandle, why warn here? */
+ }
+
do_fstat:
if (gv != PL_defgv) {
PL_laststype = OP_STAT;