[gcr] asn1: More clear dump display whether something has value/not
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr] asn1: More clear dump display whether something has value/not
- Date: Sat, 19 Apr 2014 20:38:05 +0000 (UTC)
commit c4537dfccbccf8aea2873f2a3a2459b5a6cc8b01
Author: Stef Walter <stefw redhat com>
Date: Sat Apr 19 13:08:20 2014 +0200
asn1: More clear dump display whether something has value/not
When dumping parsed DER/ASN.1 tree, print an asterisk if something
has a value, and a dot if it was parsed, but no value.
egg/egg-asn1x.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/egg/egg-asn1x.c b/egg/egg-asn1x.c
index 566a47a..4b24e8b 100644
--- a/egg/egg-asn1x.c
+++ b/egg/egg-asn1x.c
@@ -4546,6 +4546,7 @@ traverse_and_dump (GNode *node, gpointer unused)
guint i, depth;
GString *output;
gchar *string;
+ const gchar *suff;
Anode *an;
GList *l;
@@ -4559,8 +4560,13 @@ traverse_and_dump (GNode *node, gpointer unused)
dump_append_flags (output, anode_def_flags (node));
string = g_utf8_casefold (output->str, output->len - 1);
g_string_free (output, TRUE);
+ suff = "";
+ if (an->value)
+ suff = " *";
+ else if (an->parsed)
+ suff = " .";
g_print ("+ %s: %s [%s]%s\n", anode_def_name (node), anode_def_value (node),
- string, an->parsed || an->value ? " *" : "");
+ string, suff);
g_free (string);
/* Print out all the options */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]