>From c6ff1f7a3b20218cf2716cf607585e08dc36b714 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 26 Oct 2013 01:12:05 -0700 Subject: [PATCH 12/13] pidl-wireshark: clean case name as they can have no valid char for variable names For instance: [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))]16drsuapi_DsGetNCChangesMSZIPCtr1 mszip1; Signed-off-by: Matthieu Patou --- pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 96045b3..06e9937 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -751,7 +751,10 @@ sub Union($$$$) foreach (@{$e->{ELEMENTS}}) { $res.="\n\t\t$_->{CASE}:\n"; if ($_->{TYPE} ne "EMPTY") { - $res.="\t\t\t".$self->Element($_, $name, $ifname, undef)."\n"; + my $case_name = $_->{CASE}; + $case_name =~ s/case //; + $case_name =~ tr/|)(Element($_, "${name}_val${case_name}", $ifname, undef)."\n"; } $res.="\t\tbreak;\n"; } -- 1.8.1.2