Blob Blame History Raw
From a040e812b39d1fcc6aa69ca6aa5ff2fe4316a018 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 3 Oct 2016 12:36:46 +0300
Subject: [PATCH 08/49] Fix behavior when %_build_id_links is undefined

Commit bbfe1f86b2e4b5c0bd499d9f3dd9de9c9c20fff2 tries to behave sanely
and use compat setting when %_build_id_links is undefined, but
rpmExpand() never returns NULL so the original check is incorrect.
Check for empty string instead.

(cherry picked from commit 2ea72daabe3f0c4bef628d5a16768f293ffab3df)
---
 build/files.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build/files.c b/build/files.c
index eb398562a..6215bf85c 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1648,7 +1648,7 @@ static int generateBuildIDs(FileList fl)
     /* How are we supposed to create the build-id links?  */
     char *build_id_links_macro = rpmExpand("%{?_build_id_links}", NULL);
     int build_id_links;
-    if (build_id_links_macro == NULL) {
+    if (*build_id_links_macro == '\0') {
 	rpmlog(RPMLOG_WARNING,
 	       _("_build_id_links macro not set, assuming 'compat'\n"));
 	build_id_links = BUILD_IDS_COMPAT;
-- 
2.13.2