From 88772de23af57eac5c19670fde72d8e905109088 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 10 Feb 2017 10:29:44 +0100 Subject: [PATCH] libopkg: suppress empty provides When writing out status information, suppress the Provides field if there are no providers. Signed-off-by: Jo-Philipp Wich --- libopkg/pkg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libopkg/pkg.c b/libopkg/pkg.c index 265f554..64ee70a 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -731,7 +731,7 @@ pkg_formatted_field(FILE *fp, pkg_t *pkg, const char *field) } else if (strcasecmp(field, "Priority") == 0) { fprintf(fp, "Priority: %s\n", pkg->priority); } else if (strcasecmp(field, "Provides") == 0) { - if (pkg->provides_count) { + if (pkg->provides_count > 1) { fprintf(fp, "Provides:"); for(i = 1; i < pkg->provides_count; i++) { fprintf(fp, "%s %s", i == 1 ? "" : ",", -- 2.25.1