File 0001-Always-clear-the-RPMEXPAND_KEEP_QUOTED-flag-if-we-do.patch of Package rpm

From b871b6870659681448372270c061a99a8c73d9f9 Mon Sep 17 00:00:00 2001
Message-ID: <b871b6870659681448372270c061a99a8c73d9f9.1717588019.git.pmatilai@redhat.com>
From: Michael Schroeder <mls@suse.de>
Date: Wed, 5 Jun 2024 11:35:33 +0200
Subject: [PATCH] Always clear the RPMEXPAND_KEEP_QUOTED flag if we do not
 return the resulting flags

If the resulting flags cannot be returned, the caller has no way to
strip the quote characters. So we must assume that we are not to
return quotes in this case.

Fixes issue #3145
---
 rpmio/macro.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rpmio/macro.c b/rpmio/macro.c
index fb6d8aede..5b89bbfc0 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -416,6 +416,7 @@ expandThis(rpmMacroBuf mb, const char * src, size_t slen, char **target, int *fl
     umb = *mb;
     umb.buf = NULL;
     umb.error = 0;
+    umb.flags &= ~(RPMEXPAND_HAVE_QUOTED | RPMEXPAND_KEEP_QUOTED);
     if (flagsp)
 	umb.flags = *flagsp;
     /* In case of error, flag it in the "parent"... */
-- 
2.45.1

openSUSE Build Service is sponsored by