summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-10-15 00:45:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:44:44 -0500
commit5a937a0f6f62de25ce7721413a4bbf3b9b31ea59 (patch)
treeebca84c6499a31c333d7815f0d3cbdce4f62cc1c /source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm
parent5de65d5801f77838dc5cc9f856290ac95c1b8660 (diff)
downloadsamba-5a937a0f6f62de25ce7721413a4bbf3b9b31ea59.tar.gz
samba-5a937a0f6f62de25ce7721413a4bbf3b9b31ea59.tar.bz2
samba-5a937a0f6f62de25ce7721413a4bbf3b9b31ea59.zip
r11077: Fix [string] for Samba3
(This used to be commit 2f76e2a6bf8ff99ac2f9b61669d09d76a2fe920a)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm
index d582305326..9ef8f09dc4 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba3/Parser.pm
@@ -27,7 +27,7 @@ sub fatal($$) { my ($e,$s) = @_; die("$e->{FILE}:$e->{LINE}: $s\n"); }
#TODO:
# - Add some security checks (array sizes, memory alloc == NULL, etc)
# - Don't add seperate _p and _d functions if there is no deferred data
-# - [string] with non-varying arrays
+# - [string] with non-varying arrays and "surrounding" strings
# - subcontext()
# - DATA_BLOB
@@ -90,11 +90,13 @@ sub ParseElementLevelArray($$$$$$$)
my ($e,$l,$nl,$env,$varname,$what,$align) = @_;
if ($l->{IS_ZERO_TERMINATED}) {
+ return if ($what == DEFERRED);
+
my ($t,$f) = StringType($e,$l);
- pidl "if (!prs_io_$t(\"$e->{VARNAME}\", ps, depth, $varname))";
+ Align($align, 4);
+ pidl "if (!smb_io_$t(\"$e->{NAME}\", &$varname, 1, ps, depth))";
pidl "\treturn False;";
- pidl "";
$$align = 0;
return;
@@ -246,7 +248,7 @@ sub InitLevel($$$$)
}
} elsif ($l->{TYPE} eq "ARRAY" and $l->{IS_ZERO_TERMINATED}) {
my ($t,$f) = StringType($e,$l);
- pidl "init_$t(" . ParseExpr($e->{NAME}, $env) . ", $varname, $f);";
+ pidl "init_$t(&" . ParseExpr($e->{NAME}, $env) . ", ".substr($varname, 1) . ", $f);";
} elsif ($l->{TYPE} eq "ARRAY") {
pidl ParseExpr($e->{NAME}, $env) . " = $varname;";
} elsif ($l->{TYPE} eq "DATA") {