diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-09 16:55:17 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-09 16:55:17 +0000 |
commit | cb3e09590bdc6f7bb084eeb2305484eacc1a5cff (patch) | |
tree | 94d2c133471987a55cf1a1964e61f63e3a2a62a2 /perl.c | |
parent | 1a535d6f832aa2cf6a84c3d2ed80bba27d8a7dbc (diff) | |
parent | 7889fe52c8bdedf274e4826ad460ef6c3606ca6a (diff) | |
download | perl-cb3e09590bdc6f7bb084eeb2305484eacc1a5cff.tar.gz |
Integrate perlio:
[ 8049]
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-link: @8049 on //depot/perlio: 7889fe52c8bdedf274e4826ad460ef6c3606ca6a
p4raw-id: //depot/perl@8051
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; @@ -2158,23 +2158,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': |