From: Nicholas Clark Date: Thu, 3 Nov 2005 09:51:56 +0000 (+0000) Subject: Avoiding source code duplication for the lstat() on filehandle %s X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d329e6ec94ef5c5ac1218b95aaf35eb2c75b434;p=p5sagit%2Fp5-mst-13.2.git Avoiding source code duplication for the lstat() on filehandle %s warning also makes the object code slightly smaller. p4raw-id: //depot/perl@25968 --- diff --git a/pp_sys.c b/pp_sys.c index 8682be3..d2a9618 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2763,6 +2763,7 @@ PP(pp_stat) gv = cGVOP_gv; if (PL_op->op_type == OP_LSTAT) { if (gv != PL_defgv) { + do_fstat_warning_check: if (ckWARN(WARN_IO)) Perl_warner(aTHX_ packWARN(WARN_IO), "lstat() on filehandle %s", GvENAME(gv)); @@ -2792,9 +2793,8 @@ PP(pp_stat) } else if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVGV) { gv = (GV*)SvRV(sv); - if (PL_op->op_type == OP_LSTAT && ckWARN(WARN_IO)) - Perl_warner(aTHX_ packWARN(WARN_IO), - "lstat() on filehandle %s", GvENAME(gv)); + if (PL_op->op_type == OP_LSTAT) + goto do_fstat_warning_check; goto do_fstat; } sv_setpv(PL_statname, SvPV_nolen_const(sv));