From: Stanislav Brabec Date: Wed, 27 Feb 2019 22:22:40 +0000 (+0100) Subject: agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals X-Git-Tag: v2.33.2~17 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Futil-linux.git;a=commitdiff_plain;h=bed1af44f464a3eb9f155ccc30845119e3353252 agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals If the terminal is in the UTF-8 mode, get_logname() should use 8-bit processing. Signed-off-by: Stanislav Brabec Cc: Lubomir Rintel Tested-by: Lubomir Rintel --- diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 429ba5d171..70ed232c03 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -2059,7 +2059,7 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t sleep(1); tcflush(STDIN_FILENO, TCIFLUSH); - eightbit = (op->flags & F_EIGHTBITS); + eightbit = (op->flags & (F_EIGHTBITS|F_UTF8)); bp = logname; *bp = '\0';