From: Sami Kerola Date: Wed, 14 Oct 2020 21:15:03 +0000 (+0100) Subject: ul: remove function like putwp preprocessor define X-Git-Tag: v2.37-rc1~407^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52e3ce00973e37cbdc5d25217fab4ffa7b642fe9;p=thirdparty%2Futil-linux.git 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 --- 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)