summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorGerard Goossen <gerard@tty.nl>2007-03-25 15:36:31 +0200
committerDave Mitchell <davem@fdisolutions.com>2007-05-12 22:43:01 +0000
commitfb2b694ac153e3b2b3f9e40df708ecd1973cbf38 (patch)
treeb12264036e5ee5abbd5f96d6584fc13c7071215f /dump.c
parente9cc17ba00cc39cdcabc27d876cb322b6bbd3a59 (diff)
downloadperl-fb2b694ac153e3b2b3f9e40df708ecd1973cbf38.tar.gz
move the logic of combining '_' and '#' with the previous logic
from Nomad.pm to dump.c. So they are already combined in the XML dump. Subject: [PATCH] mad: combine whitespace keys '_' '#' in dump.c instead of Nomad.pm Message-Id: <20070508170341.GH17043@ostwald> p4raw-id: //depot/perl@31207
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/dump.c b/dump.c
index fd6af40144..f6366f72f5 100644
--- a/dump.c
+++ b/dump.c
@@ -2822,6 +2822,7 @@ Perl_do_op_xmldump(pTHX_ I32 level, PerlIO *file, const OP *o)
}
if (PL_madskills && o->op_madprop) {
+ char prevkey = '\0';
SV *tmpsv = newSVpvn("", 0);
MADPROP* mp = o->op_madprop;
sv_utf8_upgrade(tmpsv);
@@ -2836,6 +2837,10 @@ Perl_do_op_xmldump(pTHX_ I32 level, PerlIO *file, const OP *o)
sv_setpvn(tmpsv,"\"",1);
if (tmp)
sv_catxmlpvn(tmpsv, &tmp, 1, 0);
+ if ((tmp == '_') || (tmp == '#')) /* '_' '#' whitespace belong to the previous token. */
+ sv_catxmlpvn(tmpsv, &prevkey, 1, 0);
+ else
+ prevkey = tmp;
sv_catpv(tmpsv, "\"");
switch (mp->mad_type) {
case MAD_NULL: