c480ed
From c93476692d7e0373f147c3ed20761ea1fe836e89 Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <c93476692d7e0373f147c3ed20761ea1fe836e89@dist-git>
c480ed
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
c480ed
Date: Mon, 1 Jul 2019 17:08:16 +0200
c480ed
Subject: [PATCH] internal: introduce a family of NULLSTR macros
c480ed
MIME-Version: 1.0
c480ed
Content-Type: text/plain; charset=UTF-8
c480ed
Content-Transfer-Encoding: 8bit
c480ed
c480ed
NULLSTR_EMPTY, the quiet child,
c480ed
NULLSTR_STAR, the famous one and
c480ed
NULLSTR_MINUS, the grumpy one.
c480ed
c480ed
Signed-off-by: Ján Tomko <jtomko@redhat.com>
c480ed
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
c480ed
(cherry picked from commit bd5519deb75e9ff8adcd56d34cbe82dd6a341bcb)
c480ed
c480ed
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
c480ed
c480ed
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c480ed
Message-Id: <16722b79dbd931a33ef495b863c5716bb5d6e97c.1561993100.git.phrdina@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
---
c480ed
 src/internal.h | 15 +++++++++++++++
c480ed
 1 file changed, 15 insertions(+)
c480ed
c480ed
diff --git a/src/internal.h b/src/internal.h
c480ed
index 47ff0479d2..a4f6605a50 100644
c480ed
--- a/src/internal.h
c480ed
+++ b/src/internal.h
c480ed
@@ -244,6 +244,21 @@
c480ed
  */
c480ed
 # define EMPTYSTR(s) ((s) ? (s) : "-")
c480ed
 
c480ed
+/*
c480ed
+ * Turn a NULL string into an empty string
c480ed
+ */
c480ed
+# define NULLSTR_EMPTY(s) ((s) ? (s) : "")
c480ed
+
c480ed
+/*
c480ed
+ * Turn a NULL string into a star
c480ed
+ */
c480ed
+# define NULLSTR_STAR(s) ((s) ? (s) : "*")
c480ed
+
c480ed
+/*
c480ed
+ * Turn a NULL string into a minus sign
c480ed
+ */
c480ed
+# define NULLSTR_MINUS(s) ((s) ? (s) : "-")
c480ed
+
c480ed
 /**
c480ed
  * SWAP:
c480ed
  *
c480ed
-- 
c480ed
2.22.0
c480ed