From 8fef2c8122a8d8ca522356353d30ed25dfd4c8fe Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 21 May 2006 15:01:47 +0000 Subject: r15778: Fix bug printing ref pointers. (This used to be commit 030272e79b621c2c54354f4c89cc25c202d2dbbc) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 5a8ef53e14..2797c6c490 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -702,13 +702,15 @@ sub ParseElementPrint($$$) foreach my $l (@{$e->{LEVELS}}) { if ($l->{TYPE} eq "POINTER") { + if ($l->{POINTER_TYPE} ne "ref" or has_property($e, "keepref")) { pidl "ndr_print_ptr(ndr, \"$e->{NAME}\", $var_name);"; pidl "ndr->depth++;"; - if ($l->{POINTER_TYPE} ne "ref") { - pidl "if ($var_name) {"; - indent; + if ($l->{POINTER_TYPE} ne "ref") { + pidl "if ($var_name) {"; + indent; + } + $var_name = get_value_of($var_name); } - $var_name = get_value_of($var_name); } elsif ($l->{TYPE} eq "ARRAY") { my $length; @@ -757,11 +759,13 @@ sub ParseElementPrint($$$) foreach my $l (reverse @{$e->{LEVELS}}) { if ($l->{TYPE} eq "POINTER") { - if ($l->{POINTER_TYPE} ne "ref") { - deindent; - pidl "}"; + if ($l->{POINTER_TYPE} ne "ref" or has_property($e, "keepref")) { + if ($l->{POINTER_TYPE} ne "ref") { + deindent; + pidl "}"; + } + pidl "ndr->depth--;"; } - pidl "ndr->depth--;"; } elsif (($l->{TYPE} eq "ARRAY") and not is_charset_array($e,$l) and not has_fast_array($e,$l)) { -- cgit