]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: when logname is erased, re-enable reloads
authorStanislav Brabec <sbrabec@suse.cz>
Fri, 26 Oct 2018 13:02:17 +0000 (15:02 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 31 Oct 2018 08:35:48 +0000 (09:35 +0100)
When user starts to enter logname, 8b58ffdd blocks issue reloads.
Reloads remain blocked even if user deletes all typed characters.

Make things visually consistent: If no characters are entered,
re-enable reloads.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
term-utils/agetty.c

index cfcdffe93ae9169d4495ae87dcff62307f274b01..05a269abb9a3e00cfb653018efec4ca044bf246a 100644 (file)
@@ -2182,6 +2182,9 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
                                *bp++ = ascval;                 /* and store it */
                                break;
                        }
+                       /* Everything was erased. */
+                       if (bp == logname)
+                               goto no_reload;
                }
        }