From 5ce6f636b3f77784925a95185686f092b469a44e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 24 Jul 2024 09:13:08 +0200 Subject: [PATCH] =?utf8?q?agetty:=20fix=20ambiguous=20=E2=80=98else?= =?utf8?q?=E2=80=99=20[-Werror=3Ddangling-else]?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Karel Zak (cherry picked from commit 6a14f8d1727035a68b1fef167499930e09a2b234) --- term-utils/agetty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/term-utils/agetty.c b/term-utils/agetty.c index de490175d..a3823137d 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -2288,7 +2288,7 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t default: if ((size_t)(bp - logname) >= sizeof(logname) - 1) log_err(_("%s: input overrun"), op->tty); - if ((tp->c_lflag & ECHO) == 0) + if ((tp->c_lflag & ECHO) == 0) { /* Visualize escape sequence instead of its execution */ if (ascval == CTL('[')) /* Ideally it should be "\xe2\x90\x9b" @@ -2297,6 +2297,7 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t write_all(1, "^[", 2); else write_all(1, &c, 1); /* echo the character */ + } *bp++ = ascval; /* and store it */ break; } -- 2.47.2