summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>1999-11-06 23:16:43 +0100
committerJarkko Hietaniemi <jhi@iki.fi>1999-11-06 23:10:54 +0000
commitd0dca5578cc53544bebb81ee96b49f700f76a2a0 (patch)
treeb556eaa806dbe123695a410b80d629c9b311f78f /op.c
parentc8db6e6067ab313bf2ff131319461d5b6062de7d (diff)
downloadperl-d0dca5578cc53544bebb81ee96b49f700f76a2a0.tar.gz
[5.005_62 PATCH] binmode and locale support for -T and -B filetest operators
To: perl5-porters@perl.org Cc: Mike Blazer <blazer@mail.nevalink.ru>, Mark Borgerding <mborgerding@acm.org> Message-ID: <38279207.46448719@smtprelay.t-online.de> p4raw-id: //depot/cfgperl@4528
Diffstat (limited to 'op.c')
-rw-r--r--op.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/op.c b/op.c
index 56c2651657..bcf154dea3 100644
--- a/op.c
+++ b/op.c
@@ -5017,10 +5017,10 @@ Perl_ck_ftst(pTHX_ OP *o)
dTHR;
I32 type = o->op_type;
- if (o->op_flags & OPf_REF)
- return o;
-
- if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
+ if (o->op_flags & OPf_REF) {
+ /* nothing */
+ }
+ else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
SVOP *kid = (SVOP*)cUNOPo->op_first;
if (kid->op_type == OP_CONST && (kid->op_private & OPpCONST_BARE)) {
@@ -5028,17 +5028,24 @@ Perl_ck_ftst(pTHX_ OP *o)
OP *newop = newGVOP(type, OPf_REF,
gv_fetchpv(SvPVx(kid->op_sv, n_a), TRUE, SVt_PVIO));
op_free(o);
- return newop;
+ o = newop;
}
}
else {
op_free(o);
if (type == OP_FTTTY)
- return newGVOP(type, OPf_REF, gv_fetchpv("main::STDIN", TRUE,
+ o = newGVOP(type, OPf_REF, gv_fetchpv("main::STDIN", TRUE,
SVt_PVIO));
else
- return newUNOP(type, 0, newDEFSVOP());
+ o = newUNOP(type, 0, newDEFSVOP());
}
+#ifdef USE_LOCALE
+ if (type == OP_FTTEXT || type == OP_FTBINARY) {
+ o->op_private = 0;
+ if (PL_hints & HINT_LOCALE)
+ o->op_private |= OPpLOCALE;
+ }
+#endif
return o;
}