From 9dec788bd5a908311909e9ba11d34ff71be22e88 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sun, 29 May 2011 13:34:31 +0100 Subject: [PATCH 1/1] pp_formline: no need to *t = '\0' until end We don't care whether PL_formtarget has a trailling \0 until we return; so remove the bits where we add one in between. --- pp_ctl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pp_ctl.c b/pp_ctl.c index 0225685..acab077 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -609,7 +609,6 @@ PP(pp_formline) if (targ_is_utf8 && !item_is_utf8) { char *s; SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget)); - *t = '\0'; /* this is an unrolled sv_catpvn_utf8_upgrade(), * but with the addition of s/~/ /g */ @@ -630,7 +629,6 @@ PP(pp_formline) } if (!targ_is_utf8 && item_is_utf8) { SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget)); - *t = '\0'; sv_utf8_upgrade_flags_grow(PL_formtarget, 0, fudge + 1); t = SvEND(PL_formtarget); targ_is_utf8 = TRUE; @@ -816,7 +814,6 @@ PP(pp_formline) if (item_is_utf8) { if (!targ_is_utf8) { SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget)); - *t = '\0'; sv_utf8_upgrade_flags_grow(PL_formtarget, 0, fudge + 1); t = SvEND(PL_formtarget); @@ -849,7 +846,6 @@ PP(pp_formline) } if (targ_is_utf8 && !item_is_utf8) { SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget)); - *t = '\0'; sv_catpvn_utf8_upgrade(PL_formtarget, s, arg, nsv); for (; t < SvEND(PL_formtarget); t++) { #ifdef EBCDIC -- 1.8.3.1