X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Faction_show_graph.c;h=7b3c93af9291fcd6d45b7767ae8d31462e83f912;hb=d3cf935b4ec35cb4acedb6c278177bdd4e1776cb;hp=2f124de41974ec2b0ed926355fa29ea57ad060e3;hpb=022298601cad5a59aba37fa205f6f5ae6a364956;p=collection4.git diff --git a/src/action_show_graph.c b/src/action_show_graph.c index 2f124de..7b3c93a 100644 --- a/src/action_show_graph.c +++ b/src/action_show_graph.c @@ -28,7 +28,8 @@ struct show_graph_data_s }; typedef struct show_graph_data_s show_graph_data_t; -static void show_breadcrump_field (const char *str) /* {{{ */ +static void show_breadcrump_field (const char *str, /* {{{ */ + const char *field_name) { if ((str == NULL) || (str[0] == 0)) printf ("none"); @@ -39,8 +40,14 @@ static void show_breadcrump_field (const char *str) /* {{{ */ else { char *str_html = html_escape (str); - printf ("%s", - script_name (), str_html, str_html); + + if (field_name != NULL) + printf ("%s", + script_name (), field_name, str_html, str_html); + else + printf ("%s", + script_name (), str_html, str_html); + free (str_html); } } /* }}} void show_breadcrump_field */ @@ -62,15 +69,15 @@ static int show_breadcrump (show_graph_data_t *data) /* {{{ */ } printf ("
%s: "", prefix); - show_breadcrump_field (ident_get_host (ident)); + show_breadcrump_field (ident_get_host (ident), "host"); printf (" / "); - show_breadcrump_field (ident_get_plugin (ident)); + show_breadcrump_field (ident_get_plugin (ident), "plugin"); printf (" – "); - show_breadcrump_field (ident_get_plugin_instance (ident)); + show_breadcrump_field (ident_get_plugin_instance (ident), NULL); printf (" / "); - show_breadcrump_field (ident_get_type (ident)); + show_breadcrump_field (ident_get_type (ident), "type"); printf (" – "); - show_breadcrump_field (ident_get_type_instance (ident)); + show_breadcrump_field (ident_get_type_instance (ident), NULL); printf (""
\n"); return (0);