[egg] Don't try to encode optional sequences if empty.
authorStef Walter <stefw@collabora.co.uk>
Wed, 22 Dec 2010 15:56:36 +0000 (15:56 +0000)
committerStef Walter <stefw@collabora.co.uk>
Wed, 22 Dec 2010 15:56:36 +0000 (15:56 +0000)
egg/egg-asn1x.c

index ba0a398..122cedf 100644 (file)
@@ -1617,6 +1617,8 @@ anode_encode_prepare_structured (GNode *node, gboolean want)
 
        if (type == TYPE_SEQUENCE_OF || type == TYPE_SET_OF)
                child_want = FALSE;
+       if (anode_def_flags (node) & FLAG_OPTION)
+               want = FALSE;
 
        for (child = node->children; child; child = child->next) {
                if (anode_encode_prepare (child, child_want)) {