summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-08-25 00:01:52 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-08-25 00:01:52 +0000
commit236988e4d25eed85df605c5aa84163a8cd5d390d (patch)
tree2dde337fcf79f972ff505f69b07255e19bb58dea /pp_hot.c
parentb1dadf134bc1d7458a050c3b4ad2ce62652892ad (diff)
downloadperl-236988e4d25eed85df605c5aa84163a8cd5d390d.tar.gz
perl 5.003_03: pp_hot.c
Use memcmp instead of bcmp even when we don't care about order. Add support for tied filehandles.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index a0f85f5e66..bb7b6a6e6c 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -321,11 +321,26 @@ PP(pp_print)
GV *gv;
IO *io;
register PerlIO *fp;
+ MAGIC *mg;
if (op->op_flags & OPf_STACKED)
gv = (GV*)*++MARK;
else
gv = defoutgv;
+ if (SvMAGICAL(gv) && (mg = mg_find((SV*)gv, 'q'))) {
+ SV *sv;
+
+ PUSHMARK(MARK-1);
+ *MARK = mg->mg_obj;
+ ENTER;
+ perl_call_method("PRINT", G_SCALAR);
+ LEAVE;
+ SPAGAIN;
+ sv = POPs;
+ SP = ORIGMARK;
+ PUSHs(sv);
+ RETURN;
+ }
if (!(io = GvIO(gv))) {
if (dowarn) {
SV* sv = sv_newmortal();
@@ -822,7 +837,7 @@ play_it_again:
}
else if (!multiline) {
if (*SvPVX(pm->op_pmshort) != *s ||
- bcmp(SvPVX(pm->op_pmshort), s, pm->op_pmslen) ) {
+ memcmp(SvPVX(pm->op_pmshort), s, pm->op_pmslen) ) {
if (pm->op_pmflags & PMf_FOLD) {
if (ibcmp((U8*)SvPVX(pm->op_pmshort), (U8*)s, pm->op_pmslen) )
goto nope;
@@ -1386,7 +1401,7 @@ PP(pp_subst)
}
else if (!multiline) {
if (*SvPVX(pm->op_pmshort) != *s ||
- bcmp(SvPVX(pm->op_pmshort), s, pm->op_pmslen) ) {
+ memcmp(SvPVX(pm->op_pmshort), s, pm->op_pmslen) ) {
if (pm->op_pmflags & PMf_FOLD) {
if (ibcmp((U8*)SvPVX(pm->op_pmshort), (U8*)s, pm->op_pmslen) )
goto nope;