mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Merge remote-tracking branch 'upstream/master' into feature/timestamp-with-milliseconds
This commit is contained in:
commit
78e7575798
2 changed files with 20 additions and 17 deletions
1
AUTHORS
1
AUTHORS
|
|
@ -28,5 +28,6 @@ Alban Bedel <alban.bedel@aerq.com>
|
|||
Björn Stenberg <bjorn@haxx.se>
|
||||
Henner Zeller <h.zeller@acm.org>
|
||||
Henrik Brix Andersen <henrik@brixandersen.dk>
|
||||
Mariusz Midor <dexlab@o2.pl>
|
||||
|
||||
Thanks to everyone who has contributed to this project.
|
||||
|
|
|
|||
36
src/tty.c
36
src/tty.c
|
|
@ -790,30 +790,32 @@ int tty_connect(void)
|
|||
output_char = '\n';
|
||||
|
||||
/* Map newline character */
|
||||
if ((output_char == '\n') && (map_o_nl_crnl)) {
|
||||
char r = '\r';
|
||||
if ((output_char == '\n' || output_char == '\r') && (map_o_nl_crnl)) {
|
||||
const char *crlf = "\r\n";
|
||||
|
||||
optional_local_echo(r);
|
||||
status = write(fd, &r, 1);
|
||||
optional_local_echo(crlf[0]);
|
||||
optional_local_echo(crlf[1]);
|
||||
status = write(fd, crlf, 2);
|
||||
if (status < 0)
|
||||
warning_printf("Could not write to tty device");
|
||||
|
||||
tx_total += 2;
|
||||
delay(option.output_delay);
|
||||
} else
|
||||
{
|
||||
/* Send output to tty device */
|
||||
optional_local_echo(output_char);
|
||||
status = write(fd, &output_char, 1);
|
||||
if (status < 0)
|
||||
warning_printf("Could not write to tty device");
|
||||
fsync(fd);
|
||||
|
||||
/* Update transmit statistics */
|
||||
tx_total++;
|
||||
|
||||
/* Insert output delay */
|
||||
delay(option.output_delay);
|
||||
}
|
||||
|
||||
/* Send output to tty device */
|
||||
optional_local_echo(output_char);
|
||||
status = write(fd, &output_char, 1);
|
||||
if (status < 0)
|
||||
warning_printf("Could not write to tty device");
|
||||
fsync(fd);
|
||||
|
||||
/* Update transmit statistics */
|
||||
tx_total++;
|
||||
|
||||
/* Insert output delay */
|
||||
delay(option.output_delay);
|
||||
}
|
||||
|
||||
/* Save previous key */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue