summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-12-09 20:11:48 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-12-09 20:11:48 +0000
commitd75029d0f4549b2fe0cff3cd80934a1b6bbb54eb (patch)
tree94361304ed9ad075c82e9cf301f7a849d4b93f0a /pp_sys.c
parent7d59b7e40bca518078f3e97c802950b76d52efa2 (diff)
downloadperl-d75029d0f4549b2fe0cff3cd80934a1b6bbb54eb.tar.gz
Make write() (i.e. formats) utf8-aware by calling do_print() rather
than raw PerlIO_write() - does not seem to break any tests. p4raw-id: //depot/perlio@8055
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pp_sys.c b/pp_sys.c
index e4640bef3b..4e89351c27 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1265,13 +1265,16 @@ PP(pp_leavewrite)
s++;
}
if (s) {
- PerlIO_write(ofp, SvPVX(PL_formtarget), s - SvPVX(PL_formtarget));
+ STRLEN save = SvCUR(PL_formtarget);
+ SvCUR_set(PL_formtarget, s - SvPVX(PL_formtarget));
+ do_print(PL_formtarget, ofp);
+ SvCUR_set(PL_formtarget, save);
sv_chop(PL_formtarget, s);
FmLINES(PL_formtarget) -= IoLINES_LEFT(io);
}
}
if (IoLINES_LEFT(io) >= 0 && IoPAGE(io) > 0)
- PerlIO_write(ofp, SvPVX(PL_formfeed), SvCUR(PL_formfeed));
+ do_print(PL_formfeed, ofp);
IoLINES_LEFT(io) = IoPAGE_LEN(io);
IoPAGE(io)++;
PL_formtarget = PL_toptarget;
@@ -1332,8 +1335,7 @@ PP(pp_leavewrite)
if (ckWARN(WARN_IO))
Perl_warner(aTHX_ WARN_IO, "page overflow");
}
- if (!PerlIO_write(ofp, SvPVX(PL_formtarget), SvCUR(PL_formtarget)) ||
- PerlIO_error(fp))
+ if (!do_print(PL_formtarget, fp))
PUSHs(&PL_sv_no);
else {
FmLINES(PL_formtarget) = 0;