Skip to content

Commit

Permalink
agetty: fix ambiguous ‘else’ [-Werror=dangling-else]
Browse files Browse the repository at this point in the history
Signed-off-by: Karel Zak <[email protected]>
  • Loading branch information
karelzak committed Jul 24, 2024
1 parent 20b405c commit 6a14f8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion term-utils/agetty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
}
Expand Down

0 comments on commit 6a14f8d

Please sign in to comment.