diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-12-09 13:49:40 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-12-09 13:49:40 +0000 |
commit | 7889fe52c8bdedf274e4826ad460ef6c3606ca6a (patch) | |
tree | 3d161635f94f9d03924fbf79676ba0e4c27ae2ae /perl.c | |
parent | 553151e7a76c75a9f0ccbf6e0802e72fde2ec8f2 (diff) | |
download | perl-7889fe52c8bdedf274e4826ad460ef6c3606ca6a.tar.gz |
UTF8 output prework.
- Store $\ and $, as SVs so they can have SvUTF8 flag
- use do_print() rather than raw PerlIO_write() to print them.
p4raw-id: //depot/perlio@8049
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -473,11 +473,11 @@ perl_destruct(pTHXx) /* magical thingies */ - Safefree(PL_ofs); /* $, */ - PL_ofs = Nullch; + SvREFCNT_dec(PL_ofs_sv); /* $, */ + PL_ofs_sv = Nullsv; - Safefree(PL_ors); /* $\ */ - PL_ors = Nullch; + SvREFCNT_dec(PL_ors_sv); /* $\ */ + PL_ors_sv = Nullsv; SvREFCNT_dec(PL_rs); /* $/ */ PL_rs = Nullsv; @@ -2157,23 +2157,23 @@ Perl_moreswitches(pTHX_ char *s) case 'l': PL_minus_l = TRUE; s++; - if (PL_ors) - Safefree(PL_ors); + if (PL_ors_sv) { + SvREFCNT_dec(PL_ors_sv); + PL_ors_sv = Nullsv; + } if (isDIGIT(*s)) { - PL_ors = savepv("\n"); - PL_orslen = 1; + PL_ors_sv = newSVpvn("\n",1); numlen = 0; /* disallow underscores */ - *PL_ors = (char)scan_oct(s, 3 + (*s == '0'), &numlen); + *SvPVX(PL_ors_sv) = (char)scan_oct(s, 3 + (*s == '0'), &numlen); s += numlen; } else { if (RsPARA(PL_nrs)) { - PL_ors = "\n\n"; - PL_orslen = 2; + PL_ors_sv = newSVpvn("\n\n",2); + } + else { + PL_ors_sv = newSVsv(PL_nrs); } - else - PL_ors = SvPV(PL_nrs, PL_orslen); - PL_ors = savepvn(PL_ors, PL_orslen); } return s; case 'M': |