From 6895cf92e223a0c1ce0809af81be2599ae764167 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 13 Jun 2022 12:10:51 +0200 Subject: [PATCH] include/c: add prefix to print_features() Signed-off-by: Karel Zak --- include/c.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/c.h b/include/c.h index bb6c436cd..cbc99669f 100644 --- a/include/c.h +++ b/include/c.h @@ -438,12 +438,15 @@ static inline int xusleep(useconds_t usec) exit(eval); \ }) -static inline void print_features(const char **features) +static inline void print_features(const char **features, const char *prefix) { if (features && *features) { const char **p = features; while (p && *p) { - fputs(p == features ? " (" : ", ", stdout); + if (prefix && p == features) + printf(" (%s ", prefix); + else + fputs(p == features ? " (" : ", ", stdout); fputs(*p++, stdout); } fputc(')', stdout); @@ -454,7 +457,7 @@ static inline void print_features(const char **features) #define print_version_with_features(eval, features) __extension__ ({ \ printf(UTIL_LINUX_VERSION_NOBREAK); \ - print_features(features); \ + print_features(features, _("features:")); \ fputc('\n', stdout); \ exit(eval); \ })