mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
n_tty: Fix missing newline echo
When L_ECHONL is on, newlines are echoed regardless of the L_ECHO state; if set, ensure accumulated echoes are flushed before finishing the current input processing and before more output. Cc: <[email protected]> # 3.12.x Reported-by: Jason Gunthorpe <[email protected] Tested-by: Jason Gunthorpe <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
c42b4e6501
commit
39434abd94
1 changed files with 4 additions and 2 deletions
|
|
@ -810,7 +810,8 @@ static void process_echoes(struct tty_struct *tty)
|
|||
struct n_tty_data *ldata = tty->disc_data;
|
||||
size_t echoed;
|
||||
|
||||
if (!L_ECHO(tty) || ldata->echo_commit == ldata->echo_tail)
|
||||
if ((!L_ECHO(tty) && !L_ECHONL(tty)) ||
|
||||
ldata->echo_commit == ldata->echo_tail)
|
||||
return;
|
||||
|
||||
mutex_lock(&ldata->output_lock);
|
||||
|
|
@ -825,7 +826,8 @@ static void flush_echoes(struct tty_struct *tty)
|
|||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
|
||||
if (!L_ECHO(tty) || ldata->echo_commit == ldata->echo_head)
|
||||
if ((!L_ECHO(tty) && !L_ECHONL(tty)) ||
|
||||
ldata->echo_commit == ldata->echo_head)
|
||||
return;
|
||||
|
||||
mutex_lock(&ldata->output_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue