diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-21 18:09:10 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-21 18:09:10 +0000 |
commit | 4de5f5caa29d6a57b47c489616e3eb1627496091 (patch) | |
tree | a2cf807efaf284c5487e54c102614067dd5268aa /pp_sys.c | |
parent | 14fb0816f82645feea09be96f0558a9eca72698e (diff) | |
download | perl-4de5f5caa29d6a57b47c489616e3eb1627496091.tar.gz |
Fix the syswrite downgrade bug of
[perl #23428] Somethings rotten in unicode semantics
p4raw-id: //depot/perl@20804
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1807,9 +1807,12 @@ PP(pp_send) buffer = SvPVutf8(bufsv, blen); } else { - if (DO_UTF8(bufsv)) - sv_utf8_downgrade(bufsv, FALSE); - buffer = SvPV(bufsv, blen); + if (DO_UTF8(bufsv)) { + /* Not modifying source SV, so making a temporary copy. */ + bufsv = sv_2mortal(newSVsv(bufsv)); + sv_utf8_downgrade(bufsv, FALSE); + } + buffer = SvPV(bufsv, blen); } if (PL_op->op_type == OP_SYSWRITE) { |