git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:Minep/lunaix-os
[lunaix-os.git]
/
lunaix-os
/
hal
/
term
/
lcntls
/
lcntl.c
diff --git
a/lunaix-os/hal/term/lcntls/lcntl.c
b/lunaix-os/hal/term/lcntls/lcntl.c
index fdaf244275811feb83a4e5b876cefa199b72602f..08023183ecab1f637d704e7d66e09a62662367c2 100644
(file)
--- a/
lunaix-os/hal/term/lcntls/lcntl.c
+++ b/
lunaix-os/hal/term/lcntls/lcntl.c
@@
-80,17
+80,17
@@
lcntl_transform_seq(struct term* tdev, struct linebuffer* lbuf, bool out)
}
}
}
}
+ if (out) {
+ goto do_out;
+ }
+
if (c == '\n') {
latest_eol = cooked->ptr + 1;
if (c == '\n') {
latest_eol = cooked->ptr + 1;
- if (
!out &&
(_lf & _ECHONL)) {
+ if ((_lf & _ECHONL)) {
rbuffer_put(output, c);
}
}
rbuffer_put(output, c);
}
}
- if (out) {
- goto do_out;
- }
-
// For input procesing
if (c == '\n' || c == EOL) {
// For input procesing
if (c == '\n' || c == EOL) {
@@
-107,7
+107,8
@@
lcntl_transform_seq(struct term* tdev, struct linebuffer* lbuf, bool out)
} else if (c == SUSP) {
raise_sig(tdev, lbuf, SIGSTOP);
} else if (c == ERASE) {
} 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 {
} else if (c == KILL) {
// TODO shrink the rbuffer
} else {
@@
-146,7
+147,7
@@
lcntl_transform_seq(struct term* tdev, struct linebuffer* lbuf, bool out)
}
}
}
}
- if (!rbuffer_empty(output) && !(_lf & _NOFLSH)) {
+ if (!
out && !
rbuffer_empty(output) && !(_lf & _NOFLSH)) {
term_flush(tdev);
}
term_flush(tdev);
}