}
}
+ if (out) {
+ goto do_out;
+ }
+
if (c == '\n') {
latest_eol = cooked->ptr + 1;
- if (!out && (_lf & _ECHONL)) {
+ if ((_lf & _ECHONL)) {
rbuffer_put(output, c);
}
}
- if (out) {
- goto do_out;
- }
-
// For input procesing
if (c == '\n' || c == EOL) {
} else if (c == SUSP) {
raise_sig(tdev, lbuf, SIGSTOP);
} else if (c == ERASE) {
- rbuffer_erase(cooked);
+ if (!rbuffer_erase(cooked))
+ continue;
} else if (c == KILL) {
// TODO shrink the rbuffer
} else {
}
}
- if (!rbuffer_empty(output) && !(_lf & _NOFLSH)) {
+ if (!out && !rbuffer_empty(output) && !(_lf & _NOFLSH)) {
term_flush(tdev);
}