summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-30 00:38:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-30 00:38:32 +0000
commit9692f7e7da6d0e69b8995374e7ea7d5f6bd54236 (patch)
tree390600aa8ffa8cfd271a8e9a15882bc4631c0caa /util.c
parentc9bc2bba40c7aed51d58b598de970d52e4fa61e1 (diff)
downloadperl-9692f7e7da6d0e69b8995374e7ea7d5f6bd54236.tar.gz
(Retracted by #8261). (Unsuccessful memory access tweaks.)
p4raw-id: //depot/perl@8261
Diffstat (limited to 'util.c')
-rw-r--r--util.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/util.c b/util.c
index 0dd9fad2c3..d089df4e69 100644
--- a/util.c
+++ b/util.c
@@ -533,7 +533,7 @@ Perl_new_collate(pTHX_ char *newcoll)
if (! newcoll) {
if (PL_collation_name) {
- ++PL_collation_ix;
+ PL_collation_ix++;
Safefree(PL_collation_name);
PL_collation_name = NULL;
}
@@ -544,9 +544,10 @@ Perl_new_collate(pTHX_ char *newcoll)
}
if (! PL_collation_name || strNE(PL_collation_name, newcoll)) {
- ++PL_collation_ix;
- Safefree(PL_collation_name);
- PL_collation_name = stdize_locale(savepv(newcoll));
+ PL_collation_ix++;
+ if (PL_collation_name)
+ Safefree(PL_collation_name);
+ PL_collation_name = stdize_locale(newcoll);
PL_collation_standard = (strEQ(newcoll, "C") || strEQ(newcoll, "POSIX"));
{
@@ -605,8 +606,9 @@ Perl_new_numeric(pTHX_ char *newnum)
}
if (! PL_numeric_name || strNE(PL_numeric_name, newnum)) {
- Safefree(PL_numeric_name);
- PL_numeric_name = stdize_locale(savepv(newnum));
+ if (PL_numeric_name)
+ Safefree(PL_numeric_name);
+ PL_numeric_name = stdize_locale(newnum);
PL_numeric_standard = (strEQ(newnum, "C") || strEQ(newnum, "POSIX"));
PL_numeric_local = TRUE;
set_numeric_radix();