mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix output-delay and input-mode line combination bug
This commit is contained in:
parent
3922ce3447
commit
6a590bd598
1 changed files with 6 additions and 5 deletions
|
|
@ -259,13 +259,14 @@ ssize_t tty_write(int fd, const void *buffer, size_t count)
|
|||
{
|
||||
ssize_t retval = 0, bytes_written = 0;
|
||||
size_t i;
|
||||
unsigned char *cbuf = (unsigned char *)buffer;
|
||||
|
||||
if (option.map_o_ltu)
|
||||
{
|
||||
// Convert lower case to upper case
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
*((unsigned char*)buffer+i) = toupper(*((unsigned char*)buffer+i));
|
||||
cbuf[i] = toupper(cbuf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -274,7 +275,7 @@ ssize_t tty_write(int fd, const void *buffer, size_t count)
|
|||
// Write byte by byte with output delay
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
retval = write(fd, buffer, 1);
|
||||
retval = write(fd, &cbuf[i], 1);
|
||||
if (retval < 0)
|
||||
{
|
||||
// Error
|
||||
|
|
@ -286,7 +287,7 @@ ssize_t tty_write(int fd, const void *buffer, size_t count)
|
|||
fsync(fd);
|
||||
tcdrain(fd);
|
||||
|
||||
if (option.output_line_delay && *(unsigned char*)buffer == '\n')
|
||||
if (option.output_line_delay && cbuf[i] == '\n')
|
||||
{
|
||||
delay(option.output_line_delay);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue