]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals
authorStanislav Brabec <sbrabec@suse.cz>
Wed, 27 Feb 2019 22:22:40 +0000 (23:22 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 4 Mar 2019 10:38:28 +0000 (11:38 +0100)
If the terminal is in the UTF-8 mode, get_logname() should use 8-bit
processing.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
term-utils/agetty.c

index 0ef8ba36d87e414750e2b28eeadfb921c0c40ae7..43dbd6deadb64d07f380bf0bc43a118a90aebd7d 100644 (file)
@@ -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';