summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-12-09 13:49:40 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-12-09 13:49:40 +0000
commit7889fe52c8bdedf274e4826ad460ef6c3606ca6a (patch)
tree3d161635f94f9d03924fbf79676ba0e4c27ae2ae /perl.c
parent553151e7a76c75a9f0ccbf6e0802e72fde2ec8f2 (diff)
downloadperl-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.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/perl.c b/perl.c
index 7064e2b9eb..eabe43c4ca 100644
--- a/perl.c
+++ b/perl.c
@@ -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':