From 5740a06b320d56840439fb7fe3b8b27f341ddaa7 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 4 Oct 2014 21:19:12 -0700 Subject: pidl: Improve string delection in function ContainsString Change-Id: I037e8b5f54fca8b512fd14edbefa34e59cb7f953 Signed-off-by: Matthieu Patou Reviewed-by: Stefan Metzmacher --- pidl/lib/Parse/Pidl/NDR.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm index 682715227f..d65cbe7037 100644 --- a/pidl/lib/Parse/Pidl/NDR.pm +++ b/pidl/lib/Parse/Pidl/NDR.pm @@ -952,9 +952,19 @@ sub ContainsString($) if (property_matches($e, "flag", ".*STR_NULLTERM.*")) { return 1; } + if (exists($e->{LEVELS}) and $e->{LEVELS}->[0]->{TYPE} eq "ARRAY" and + ($e->{LEVELS}->[0]->{IS_FIXED} or $e->{LEVELS}->[0]->{IS_INLINE}) and + has_property($e, "charset")) + { + return 1; + } + foreach my $l (@{$e->{LEVELS}}) { return 1 if ($l->{TYPE} eq "ARRAY" and $l->{IS_ZERO_TERMINATED}); } + if (property_matches($e, "charset", ".*DOS.*")) { + return 1; + } return 0; } -- cgit