Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125040
b: refs/heads/master
c: acc71bb
h: refs/heads/master
v: v3
  • Loading branch information
Joe Peterson authored and Linus Torvalds committed Jan 2, 2009
1 parent 7a35844 commit d7f26fd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a59c0d6f14315a3f300f6f3786137213727e4c47
refs/heads/master: acc71bbad33478973dbed68ebbc2d76dac9a51bd
55 changes: 38 additions & 17 deletions trunk/drivers/char/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,7 @@ static inline void n_tty_receive_parity_error(struct tty_struct *tty,
static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
{
unsigned long flags;
int parmrk;

if (tty->raw) {
put_tty_queue(c, tty);
Expand Down Expand Up @@ -1144,21 +1145,24 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
*/
if (!test_bit(c, tty->process_char_map) || tty->lnext) {
tty->lnext = 0;
if (L_ECHO(tty)) {
finish_erasing(tty);
if (tty->read_cnt >= N_TTY_BUF_SIZE-1) {
/* beep if no space */
parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
/* beep if no space */
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
return;
}
return;
}
if (L_ECHO(tty)) {
finish_erasing(tty);
/* Record the column of first canon char. */
if (tty->canon_head == tty->read_head)
echo_set_canon_col(tty);
echo_char(c, tty);
process_echoes(tty);
}
if (I_PARMRK(tty) && c == (unsigned char) '\377')
if (parmrk)
put_tty_queue(c, tty);
put_tty_queue(c, tty);
return;
Expand Down Expand Up @@ -1250,28 +1254,42 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
return;
}
if (c == '\n') {
if (L_ECHO(tty) || L_ECHONL(tty)) {
if (tty->read_cnt >= N_TTY_BUF_SIZE-1)
if (tty->read_cnt >= N_TTY_BUF_SIZE) {
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
}
return;
}
if (L_ECHO(tty) || L_ECHONL(tty)) {
echo_char_raw('\n', tty);
process_echoes(tty);
}
goto handle_newline;
}
if (c == EOF_CHAR(tty)) {
if (tty->read_cnt >= N_TTY_BUF_SIZE)
return;
if (tty->canon_head != tty->read_head)
set_bit(TTY_PUSH, &tty->flags);
c = __DISABLED_CHAR;
goto handle_newline;
}
if ((c == EOL_CHAR(tty)) ||
(c == EOL2_CHAR(tty) && L_IEXTEN(tty))) {
parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty))
? 1 : 0;
if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) {
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
}
return;
}
/*
* XXX are EOL_CHAR and EOL2_CHAR echoed?!?
*/
if (L_ECHO(tty)) {
if (tty->read_cnt >= N_TTY_BUF_SIZE-1)
echo_char_raw('\a', tty);
/* Record the column of first canon char. */
if (tty->canon_head == tty->read_head)
echo_set_canon_col(tty);
Expand All @@ -1282,7 +1300,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
* XXX does PARMRK doubling happen for
* EOL_CHAR and EOL2_CHAR?
*/
if (I_PARMRK(tty) && c == (unsigned char) '\377')
if (parmrk)
put_tty_queue(c, tty);

handle_newline:
Expand All @@ -1299,14 +1317,17 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
}
}

if (L_ECHO(tty)) {
finish_erasing(tty);
if (tty->read_cnt >= N_TTY_BUF_SIZE-1) {
/* beep if no space */
parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
/* beep if no space */
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
return;
}
return;
}
if (L_ECHO(tty)) {
finish_erasing(tty);
if (c == '\n')
echo_char_raw('\n', tty);
else {
Expand All @@ -1318,7 +1339,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
process_echoes(tty);
}

if (I_PARMRK(tty) && c == (unsigned char) '\377')
if (parmrk)
put_tty_queue(c, tty);

put_tty_queue(c, tty);
Expand Down

0 comments on commit d7f26fd

Please sign in to comment.