util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals
@ 2019-02-27 22:22 Stanislav Brabec
  2019-03-01  8:04 ` Lubomir Rintel
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislav Brabec @ 2019-02-27 22:22 UTC (permalink / raw)
  To: util-linux; +Cc: Lubomir Rintel

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>
---
 term-utils/agetty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 0ef8ba36d..43dbd6dea 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';
 
-- 
2.20.1

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@suse.com
Křižíkova 148/34 (Corso IIa)                    tel: +420 284 084 060
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals
  2019-02-27 22:22 [PATCH 2/2] agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals Stanislav Brabec
@ 2019-03-01  8:04 ` Lubomir Rintel
  2019-03-04 10:40   ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Lubomir Rintel @ 2019-03-01  8:04 UTC (permalink / raw)
  To: Stanislav Brabec, util-linux

On Wed, 2019-02-27 at 23:22 +0100, Stanislav Brabec wrote:
> 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>

(both patches)

Thanks
Lubo

> ---
>  term-utils/agetty.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/term-utils/agetty.c b/term-utils/agetty.c
> index 0ef8ba36d..43dbd6dea 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';
>  
> -- 
> 2.20.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals
  2019-03-01  8:04 ` Lubomir Rintel
@ 2019-03-04 10:40   ` Karel Zak
  0 siblings, 0 replies; 3+ messages in thread
From: Karel Zak @ 2019-03-04 10:40 UTC (permalink / raw)
  To: Lubomir Rintel; +Cc: Stanislav Brabec, util-linux

On Fri, Mar 01, 2019 at 09:04:54AM +0100, Lubomir Rintel wrote:
> Tested-by: Lubomir Rintel <lkundrak@v3.sk>

Thanks!

> >  term-utils/agetty.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-04 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27 22:22 [PATCH 2/2] agetty: Switch to 8-bit processing in get_logname() for UTF-8 terminals Stanislav Brabec
2019-03-01  8:04 ` Lubomir Rintel
2019-03-04 10:40   ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).