From 52e3ce00973e37cbdc5d25217fab4ffa7b642fe9 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Wed, 14 Oct 2020 22:15:03 +0100 Subject: [PATCH] ul: remove function like putwp preprocessor define The #ifdef HAVE_WIDECHAR can be removed, because the command already is using wide character functions elsewhere without fallbacks. Signed-off-by: Sami Kerola --- text-utils/ul.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/text-utils/ul.c b/text-utils/ul.c index 4cd3b63581..190c7cdb5a 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -63,21 +63,6 @@ #include "c.h" #include "closestream.h" -#ifdef HAVE_WIDECHAR -/* Output an ASCII character as a wide character */ -static int put1wc(int c) -{ - if (putwchar(c) == WEOF) - return EOF; - - return c; -} - -# define putwp(s) tputs(s, STDOUT_FILENO, put1wc) -#else -# define putwp(s) putp(s) -#endif - #define IESC '\033' #define SO '\016' #define SI '\017' @@ -254,12 +239,18 @@ static void sig_handler(int signo __attribute__((__unused__))) _exit(EXIT_SUCCESS); } +static int ul_putwchar(int c) +{ + if (putwchar(c) == WEOF) + return EOF; + return c; +} + static void print_out(char *line) { if (line == NULL) return; - - putwp(line); + tputs(line, STDOUT_FILENO, ul_putwchar); } static void xsetmode(struct ul_ctl *ctl, struct term_caps const *const tcs, int newmode) -- 2.47.2