[gnome-keyring/trust-store] [egg] Don't try to encode optional sequences if empty.



commit 962e450cba176d1d4245aa9672e25ffe39372d87
Author: Stef Walter <stefw collabora co uk>
Date:   Wed Dec 22 15:56:36 2010 +0000

    [egg] Don't try to encode optional sequences if empty.

 egg/egg-asn1x.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/egg/egg-asn1x.c b/egg/egg-asn1x.c
index ba0a398..122cedf 100644
--- a/egg/egg-asn1x.c
+++ b/egg/egg-asn1x.c
@@ -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)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]