summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-12 13:33:24 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-12 13:45:56 -0800
commitb6cb94c5b90e1d814bbb4b070425ee261df0ce7e (patch)
tree0f4bcd7bd7d11f2c231a6c467923a1fe7c601ee8
parentba8182f85e239b53e3089116cd5a3d262a629667 (diff)
downloadperl-b6cb94c5b90e1d814bbb4b070425ee261df0ce7e.tar.gz
Simplify logic in pp_sys.c:pp_fttty
name is only set when there is no gv. As of a couple of commits ago, tmpsv is only used in that else block where it is set.
-rw-r--r--pp_sys.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 0131a2e86b..b8c212c6ab 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3248,7 +3248,6 @@ PP(pp_fttty)
dSP;
int fd;
GV *gv;
- SV *tmpsv = NULL;
char *name = NULL;
STRLEN namelen;
@@ -3259,7 +3258,7 @@ PP(pp_fttty)
if (PL_op->op_flags & OPf_REF)
gv = cGVOP_gv;
else {
- tmpsv = POPs;
+ SV *tmpsv = POPs;
if (!(gv = MAYBE_DEREF_GV_nomg(tmpsv))) {
name = SvPV_nomg(tmpsv, namelen);
gv = gv_fetchpvn_flags(name, namelen, SvUTF8(tmpsv), SVt_PVIO);
@@ -3268,12 +3267,8 @@ PP(pp_fttty)
if (GvIO(gv) && IoIFP(GvIOp(gv)))
fd = PerlIO_fileno(IoIFP(GvIOp(gv)));
- else if (!gv && SvOK(tmpsv)) {
- if (isDIGIT(*name))
+ else if (name && isDIGIT(*name))
fd = atoi(name);
- else
- RETPUSHUNDEF;
- }
else
RETPUSHUNDEF;
if (PerlLIO_isatty(fd))