]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ul: remove function like putwp preprocessor define
authorSami Kerola <kerolasa@iki.fi>
Wed, 14 Oct 2020 21:15:03 +0000 (22:15 +0100)
committerSami Kerola <kerolasa@iki.fi>
Tue, 20 Oct 2020 19:29:27 +0000 (20:29 +0100)
The #ifdef HAVE_WIDECHAR can be removed, because the command already is
using wide character functions elsewhere without fallbacks.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/ul.c

index 4cd3b635810d928fa1271efde491d27ebed2ab25..190c7cdb5a026bb4601c11bd0710d3c1cbe30a64 100644 (file)
 #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)