]> 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>
Tue, 2 Apr 2019 10:57:51 +0000 (12:57 +0200)
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 429ba5d1718e1e61b2fc747c2a8f6c67a9870c4e..70ed232c0313ce65dd6e1cdf9786fad091644e25 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';