Add Windows version info resource.
[obnox/wireshark/wip.git] / print.c
diff --git a/print.c b/print.c
index a4c153e0f93b00a5dc4832332db279e650d45956..7297c10daf6bd16a9733fcec06cdb58254171b8e 100644 (file)
--- a/print.c
+++ b/print.c
@@ -154,18 +154,18 @@ void proto_tree_print_node(proto_node *node, gpointer data)
                proto_item_fill_label(fi, label_str);
        }
 
-    if(PROTO_ITEM_IS_GENERATED(node)) {
-        label_ptr = g_strdup_printf("[%s]", label_ptr);
-    }
+       if (PROTO_ITEM_IS_GENERATED(node)) {
+               label_ptr = g_strdup_printf("[%s]", label_ptr);
+       }
 
        if (!print_line(pdata->stream, pdata->level, label_ptr)) {
                pdata->success = FALSE;
                return;
        }
 
-    if(PROTO_ITEM_IS_GENERATED(node)) {
-        g_free(label_ptr);
-    }
+       if (PROTO_ITEM_IS_GENERATED(node)) {
+               g_free(label_ptr);
+       }
 
        /* If it's uninterpreted data, dump it (unless our caller will
           be printing the entire packet in hex). */
@@ -257,7 +257,9 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
                        label_ptr = "";
                }
 
-               fputs("<field show=\"", pdata->fh);
+               /* Show empty name since it is a required field */
+               fputs("<field name=\"", pdata->fh);
+               fputs("\" show=\"", pdata->fh);
                print_escaped_xml(pdata->fh, label_ptr);
 
                fprintf(pdata->fh, "\" size=\"%d", fi->length);
@@ -341,8 +343,8 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
                default:
                        /* XXX - this is a hack until we can just call
                         * fvalue_to_string_repr() for *all* FT_* types. */
-                       dfilter_string = proto_construct_dfilter_string(fi,
-                                       pdata->edt);
+                       dfilter_string = proto_construct_match_selected_string(fi,
+                           pdata->edt);
                        if (dfilter_string != NULL) {
                                chop_len = strlen(fi->hfinfo->abbrev) + 4; /* for " == " */
 
@@ -359,6 +361,14 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
                                fputs("\" show=\"", pdata->fh);
                                print_escaped_xml(pdata->fh, &dfilter_string[chop_len]);
                        }
+
+                       /*
+                        * XXX - should we omit "value" for any fields?
+                        * What should we do for fields whose length is 0?
+                        * They might come from a pseudo-header or from
+                        * the capture header (e.g., time stamps), or
+                        * they might be generated fields.
+                        */
                        if (fi->length > 0) {
                                fputs("\" value=\"", pdata->fh);
 
@@ -368,8 +378,8 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
                                        write_pdml_field_hex_value(pdata, fi);
                                }
                                else {
-                    write_pdml_field_hex_value(pdata, fi);
-                }
+                                       write_pdml_field_hex_value(pdata, fi);
+                               }
                        }
                }