From: Jo-Philipp Wich Date: Fri, 10 Feb 2017 09:29:44 +0000 (+0100) Subject: libopkg: suppress empty provides X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=88772de23af57eac5c19670fde72d8e905109088;p=oweals%2Fopkg-lede.git libopkg: suppress empty provides When writing out status information, suppress the Provides field if there are no providers. Signed-off-by: Jo-Philipp Wich --- 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 ? "" : ",",