Blob Blame History Raw
From c93476692d7e0373f147c3ed20761ea1fe836e89 Mon Sep 17 00:00:00 2001
Message-Id: <c93476692d7e0373f147c3ed20761ea1fe836e89@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Mon, 1 Jul 2019 17:08:16 +0200
Subject: [PATCH] internal: introduce a family of NULLSTR macros
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

NULLSTR_EMPTY, the quiet child,
NULLSTR_STAR, the famous one and
NULLSTR_MINUS, the grumpy one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit bd5519deb75e9ff8adcd56d34cbe82dd6a341bcb)

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Message-Id: <16722b79dbd931a33ef495b863c5716bb5d6e97c.1561993100.git.phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/internal.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/internal.h b/src/internal.h
index 47ff0479d2..a4f6605a50 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -244,6 +244,21 @@
  */
 # define EMPTYSTR(s) ((s) ? (s) : "-")
 
+/*
+ * Turn a NULL string into an empty string
+ */
+# define NULLSTR_EMPTY(s) ((s) ? (s) : "")
+
+/*
+ * Turn a NULL string into a star
+ */
+# define NULLSTR_STAR(s) ((s) ? (s) : "*")
+
+/*
+ * Turn a NULL string into a minus sign
+ */
+# define NULLSTR_MINUS(s) ((s) ? (s) : "-")
+
 /**
  * SWAP:
  *
-- 
2.22.0