]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: fix ambiguous ‘else’ [-Werror=dangling-else]
authorKarel Zak <kzak@redhat.com>
Wed, 24 Jul 2024 07:13:08 +0000 (09:13 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Jan 2025 23:16:36 +0000 (00:16 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 6a14f8d1727035a68b1fef167499930e09a2b234)

term-utils/agetty.c

index de490175d80e8eefa6f52c7fea931f913a56c064..a3823137d0a73d8552c1e25ddb1171cb91464ef0 100644 (file)
@@ -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;
                        }