From: Matthew Fernandez Date: Sun, 6 Sep 2020 17:22:49 +0000 (-0700) Subject: simplify gvplugin_list with agxbprint X-Git-Tag: 2.46.0~20^2^2~77^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=292d65494252562489cf901c7886f00609bb406d;p=graphviz simplify gvplugin_list with agxbprint --- diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index 0fc60408f..5d03f05ac 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -377,10 +377,7 @@ char *gvplugin_list(GVC_t * gvc, api_t api, const char *str) /* list only the matching type, or all types if s is an empty string */ if (!s[0] || strcasecmp(s, q) == 0) { /* list each member of the matching type as "type:path" */ - agxbputc(&xb, ' '); - agxbput(&xb, pnext->typestr); - agxbputc(&xb, ':'); - agxbput(&xb, pnext->package->name); + agxbprint(&xb, " %s:%s", pnext->typestr, pnext->package->name); new = FALSE; } free(q); @@ -397,8 +394,7 @@ char *gvplugin_list(GVC_t * gvc, api_t api, const char *str) *p++ = '\0'; if (!typestr_last || strcasecmp(typestr_last, q) != 0) { /* list it as "type" i.e. w/o ":path" */ - agxbputc(&xb, ' '); - agxbput(&xb, q); + agxbprint(&xb, " %s", q); new = FALSE; } if (!typestr_last)