ppisar / rpms / pkgconf

Forked from rpms/pkgconf 4 months ago
Clone
Blob Blame History Raw
From 5825e2c6d608ef74a97349e81d750ab95c53cf50 Mon Sep 17 00:00:00 2001
From: Kai Pastor <dg0yt@darc.de>
Date: Fri, 1 Dec 2023 22:12:20 +0100
Subject: [PATCH 3/3] Fix crash on two-word expressions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 cli/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cli/main.c b/cli/main.c
index 4e1e2d3..ca8bf88 100644
--- a/cli/main.c
+++ b/cli/main.c
@@ -1405,6 +1405,15 @@ cleanup3:
 			pkgconf_queue_push(&pkgq, package);
 			pkg_optind++;
 		}
+		else if (argv[pkg_optind + 2] == NULL)
+		{
+			char packagebuf[PKGCONF_BUFSIZE];
+
+			snprintf(packagebuf, sizeof packagebuf, "%s %s", package, argv[pkg_optind + 1]);
+			pkg_optind += 2;
+
+			pkgconf_queue_push(&pkgq, packagebuf);
+		}
 		else
 		{
 			char packagebuf[PKGCONF_BUFSIZE];
-- 
2.44.0