[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: loginutils, login prompt
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2019-01-29 14:09:12
Message-ID: CAK1hOcOt8q087ZgSF0GYPc1qQDZ5MkGmuto0WEMCq8T3XYGMhA () mail ! gmail ! com
[Download RAW message or body]
On Mon, Jan 28, 2019 at 10:36 AM אלכסיי סיליוק
<alex.silyuk@gmail.com> wrote:
>
> hello, I am using loginutils, and I see that
> at login prompt if I entering username incorrect and want to remove part of \
> username, I cant to edit it, in code I see you using getting username char by char, \
> I want to get name only after entering and I will write patch for myself.
This code should be handling it? CTL(H) / 0x7f case labels:
/* Read name, watch for break, erase, kill, end-of-line */
bp = G.line_buf;
while (1) {
/* Do not report trivial EINTR/EIO errors */
errno = EINTR; /* make read of 0 bytes be silent too */
if (read(STDIN_FILENO, &c, 1) < 1) {
finalize_tty_attrs();
if (errno == EINTR || errno == EIO)
exit(EXIT_SUCCESS);
bb_perror_msg_and_die(bb_msg_read_error);
}
switch (c) {
case '\r':
case '\n':
*bp = '\0';
G.eol = c;
goto got_logname;
case CTL('H'):
case 0x7f:
G.tty_attrs.c_cc[VERASE] = c;
if (bp > G.line_buf) {
full_write(STDOUT_FILENO,
"\010 \010", 3);
bp--;
}
break;
Can you diagnose why this does not work for you?
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic