Util-Linux Archive on lore.kernel.org
 help / Atom feed
* [PATCH] agetty: when logname is erased, re-enable reloads
@ 2018-10-26 13:02 Stanislav Brabec
  2018-10-27 15:17 ` Lubomir Rintel
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislav Brabec @ 2018-10-26 13:02 UTC (permalink / raw)
  To: util-linux; +Cc: Lubomir Rintel, Karel Zak

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>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Karel Zak <kzak@redhat.com>
---
 term-utils/agetty.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index cfcdffe93..05a269abb 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -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;
 		}
 	}
 
-- 
2.19.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: +49 911 7405384547
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	[flat|nested] 3+ messages in thread

* Re: [PATCH] agetty: when logname is erased, re-enable reloads
  2018-10-26 13:02 [PATCH] agetty: when logname is erased, re-enable reloads Stanislav Brabec
@ 2018-10-27 15:17 ` Lubomir Rintel
  2018-10-31  8:37   ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Lubomir Rintel @ 2018-10-27 15:17 UTC (permalink / raw)
  To: Stanislav Brabec, util-linux; +Cc: Karel Zak

On Fri, 2018-10-26 at 15:02 +0200, Stanislav Brabec wrote:
> 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>
> Cc: Lubomir Rintel <lkundrak@v3.sk>
> Cc: Karel Zak <kzak@redhat.com>

Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>

Thanks,
Lubo

> ---
>  term-utils/agetty.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/term-utils/agetty.c b/term-utils/agetty.c
> index cfcdffe93..05a269abb 100644
> --- a/term-utils/agetty.c
> +++ b/term-utils/agetty.c
> @@ -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;
>  		}
>  	}
>  
> -- 
> 2.19.1
> 


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

* Re: [PATCH] agetty: when logname is erased, re-enable reloads
  2018-10-27 15:17 ` Lubomir Rintel
@ 2018-10-31  8:37   ` Karel Zak
  0 siblings, 0 replies; 3+ messages in thread
From: Karel Zak @ 2018-10-31  8:37 UTC (permalink / raw)
  To: Lubomir Rintel; +Cc: Stanislav Brabec, util-linux

On Sat, Oct 27, 2018 at 05:17:09PM +0200, Lubomir Rintel wrote:
> On Fri, 2018-10-26 at 15:02 +0200, Stanislav Brabec wrote:
> > 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>
> > Cc: Lubomir Rintel <lkundrak@v3.sk>
> > Cc: Karel Zak <kzak@redhat.com>
> 
> Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
> Tested-by: Lubomir Rintel <lkundrak@v3.sk>

Applied. Thanks guys!

    Karel

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

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 13:02 [PATCH] agetty: when logname is erased, re-enable reloads Stanislav Brabec
2018-10-27 15:17 ` Lubomir Rintel
2018-10-31  8:37   ` Karel Zak

Util-Linux Archive on lore.kernel.org

Archives are clonable: git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org util-linux@archiver.kernel.org
	public-inbox-index util-linux


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox