From 292d65494252562489cf901c7886f00609bb406d Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 6 Sep 2020 10:22:49 -0700 Subject: [PATCH] simplify gvplugin_list with agxbprint --- lib/gvc/gvplugin.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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) -- 2.40.0