pidl: Improve string delection in function ContainsString
authorMatthieu Patou <mat@matws.net>
Sun, 5 Oct 2014 04:19:12 +0000 (21:19 -0700)
committerStefan Metzmacher <metze@samba.org>
Thu, 9 Oct 2014 20:06:46 +0000 (22:06 +0200)
Change-Id: I037e8b5f54fca8b512fd14edbefa34e59cb7f953
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
pidl/lib/Parse/Pidl/NDR.pm

index 682715227f5c91f7c8a61093962330b8acfec7a5..d65cbe7037268e1bde919034bebdba0038aea99a 100644 (file)
@@ -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;
 }