From a97b75ab2c1d031982c35a4886102413e4ec8eee Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 4 Aug 2023 08:38:48 +0000 Subject: [PATCH] main: explicitly error with --modversion and more than 1 package being queried --- cli/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/main.c b/cli/main.c index 4dceb3b..67fc289 100644 --- a/cli/main.c +++ b/cli/main.c @@ -1326,7 +1326,16 @@ cleanup3: * the limit, stop adding packages to the queue. */ if (maximum_package_count > 0 && pkgq.length >= maximum_package_count) + { + if ((want_flags & PKG_MODVERSION) == PKG_MODVERSION) + { + fprintf(stderr, "pkgconf: --modversion requested with multiple packages, output would be ambiguous\n"); + ret = EXIT_FAILURE; + goto out; + } + break; + } while (isspace((unsigned char)package[0])) package++;