summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2003-12-14 15:32:32 +0000
committerNicholas Clark <nick@ccl4.org>2003-12-14 15:32:32 +0000
commita5993b18fa9f77ffdd5da5fc1fd5905220e5c5bd (patch)
tree3a93899dc778583642056101c838b9cbc5c929be /hv.c
parent1d4b8ca2d968acd74374ff18bcbf954301de779d (diff)
downloadperl-a5993b18fa9f77ffdd5da5fc1fd5905220e5c5bd.tar.gz
Clean up a bug I introduced into caseless ENV hv_delete
(should be the proper fix for 21870 and 21872's band aid) p4raw-id: //depot/perl@21904
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/hv.c b/hv.c
index 78b1f9de2a..7115332c92 100644
--- a/hv.c
+++ b/hv.c
@@ -902,25 +902,20 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
}
return Nullsv; /* element cannot be deleted */
}
- }
#ifdef ENV_IS_CASELESS
- if (mg_find((SV*)hv, PERL_MAGIC_env)) {
- /* XXX This code isn't UTF8 clean. */
- keysv = sv_2mortal(newSVpvn(key,klen));
- key = strupr(SvPVX(keysv));
-
-#if 0
- /* keysave not in scope - don't understand - NI-S */
- if (k_flags & HVhek_FREEKEY) {
- Safefree(keysave);
+ else if (mg_find((SV*)hv, PERL_MAGIC_env)) {
+ /* XXX This code isn't UTF8 clean. */
+ keysv = sv_2mortal(newSVpvn(key,klen));
+ if (k_flags & HVhek_FREEKEY) {
+ Safefree(key);
+ }
+ key = strupr(SvPVX(keysv));
+ is_utf8 = 0;
+ k_flags = 0;
+ hash = 0;
}
#endif
-
- is_utf8 = 0;
- k_flags = 0;
- hash = 0;
}
-#endif
}
}
xhv = (XPVHV*)SvANY(hv);