From bd5519deb75e9ff8adcd56d34cbe82dd6a341bcb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Tue, 12 Feb 2019 17:01:09 +0100 Subject: [PATCH] internal: introduce a family of NULLSTR macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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 Reviewed-by: Andrea Bolognani --- src/internal.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/internal.h b/src/internal.h index 3f3e567ac9..7c11f57e33 100644 --- a/src/internal.h +++ b/src/internal.h @@ -245,6 +245,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.39.5