pidl/ws: fix missing $name when generating MAPI dissector
authorAurelien Aptel <aaptel@suse.com>
Wed, 18 May 2016 13:01:56 +0000 (15:01 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 20 Jun 2016 14:20:00 +0000 (16:20 +0200)
Port Wireshark commit 0e80176

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Fri Mar 4 19:28:26 2016 +0100

    PIDL (NDR): fix missing $name when regenerate MAPI dissector

    Issue coming from ge41f08858b

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 20 16:20:00 CEST 2016 on sn-devel-144

pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index 72a144f09f7ec7ef7f1f4cf4228cc9d5cd6f5c9b..816164615ee51ef50e9b8be23bc2ad87233b0c3e 100644 (file)
@@ -454,15 +454,18 @@ sub Element($$$$$$)
                }
                my $switch_type = "g${switch_raw_type}";
 
-               $moreparam = ", $switch_type *".$name;
-
+               if ($name ne "") {
+                       $moreparam = ", $switch_type *".$name;
+               } else {
+                       $moreparam = "";
+               }
                if (($e->{PROPERTIES}->{switch_is} eq "") && ($switchvars{$name}) &&
                        #not a "native" type
                        (!($type =~ /^uint(8|16|1632|32|3264|64)/))) {
                        $param = $name;
                } elsif ( $switch_dt->{DATA}->{TYPE} eq "ENUM") {
                        $param = $name;
-               } else {
+               } elsif ($name ne "") {
                        $param = "*".$name;
                }