From: perl-5.8.0@ton.iguana.be Date: Sun, 6 Feb 2005 22:03:20 +0000 (+0000) Subject: [perl #34076] P/p pack formats only recognize literal undef X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=28a4f200aaf4705198a8689fe5f7fabc732dc669;p=p5sagit%2Fp5-mst-13.2.git [perl #34076] P/p pack formats only recognize literal undef From: perl-5.8.0@ton.iguana.be (via RT) Message-ID: p4raw-id: //depot/perl@23951 --- diff --git a/pp_pack.c b/pp_pack.c index 690cd35..0cabe92 100644 --- a/pp_pack.c +++ b/pp_pack.c @@ -2685,8 +2685,8 @@ S_pack_rec(pTHX_ SV *cat, register tempsym_t* symptr, register SV **beglist, SV case 'p': while (len-- > 0) { fromstr = NEXTFROM; - if (fromstr == &PL_sv_undef) - aptr = NULL; + SvGETMAGIC(fromstr); + if (!SvOK(fromstr)) aptr = NULL; else { STRLEN n_a; /* XXX better yet, could spirit away the string to @@ -2702,9 +2702,9 @@ S_pack_rec(pTHX_ SV *cat, register tempsym_t* symptr, register SV **beglist, SV "Attempt to pack pointer to temporary value"); } if (SvPOK(fromstr) || SvNIOK(fromstr)) - aptr = SvPV(fromstr,n_a); + aptr = SvPV_flags(fromstr, n_a, 0); else - aptr = SvPV_force(fromstr,n_a); + aptr = SvPV_force_flags(fromstr, n_a, 0); } DO_BO_PACK_P(aptr); sv_catpvn(cat, (char*)&aptr, sizeof(char*));