This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_formline: no need to *t = '\0' until end
[perl5.git] / pp_ctl.c
index 0225685..acab077 100644 (file)
--- 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));
            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 */
 
                /* 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));
            }
            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;
                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));
                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);
                        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));
                }
                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
                    sv_catpvn_utf8_upgrade(PL_formtarget, s, arg, nsv);
                    for (; t < SvEND(PL_formtarget); t++) {
 #ifdef EBCDIC