From 2ddc85731e4bef6f719bef05bb370546c88980b7 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 26 Oct 2013 01:12:05 -0700 Subject: [PATCH] WHY??? 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 WHY drsuapi_dissect_element_DsGetNCChangesCompressedCtr_val1DRSUAPI_COMPRESSION_TYPE_MSZIP16_mszip1 instead of the simple drsuapi_dissect_element_DsGetNCChangesCompressedCtr_mszip1 we had before? --- 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 8740f154ebae..216efc7b462b 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -758,7 +758,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"; } -- 2.34.1