mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Increase line buffer size
Just to make sure we accept very long filenames.
This commit is contained in:
parent
c9c5f03c10
commit
07864a0e78
1 changed files with 10 additions and 8 deletions
16
src/tty.c
16
src/tty.c
|
|
@ -157,6 +157,7 @@ static char *tty_buffer_write_ptr = tty_buffer;
|
||||||
static pthread_t thread;
|
static pthread_t thread;
|
||||||
static int pipefd[2];
|
static int pipefd[2];
|
||||||
static pthread_mutex_t mutex_input_ready = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t mutex_input_ready = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
static char line[BUFSIZ];
|
||||||
|
|
||||||
static void optional_local_echo(char c)
|
static void optional_local_echo(char c)
|
||||||
{
|
{
|
||||||
|
|
@ -484,18 +485,19 @@ static void toggle_line(const char *line_name, int mask, enum line_mode_t line_m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_LINE 100
|
|
||||||
static char line[MAX_LINE];
|
|
||||||
|
|
||||||
static int tio_readln(void)
|
static int tio_readln(void)
|
||||||
{
|
{
|
||||||
char *p = line;
|
char *p = line;
|
||||||
|
|
||||||
/* Read line, accept BS and DEL as rubout characters */
|
/* Read line, accept BS and DEL as rubout characters */
|
||||||
for (p = line ; p < &line[MAX_LINE-1]; ) {
|
for (p = line ; p < &line[BUFSIZ-1]; )
|
||||||
if (read(pipefd[0], p, 1) > 0) {
|
{
|
||||||
if (*p == 0x08 || *p == 0x7f) {
|
if (read(pipefd[0], p, 1) > 0)
|
||||||
if (p > line ) {
|
{
|
||||||
|
if (*p == 0x08 || *p == 0x7f)
|
||||||
|
{
|
||||||
|
if (p > line )
|
||||||
|
{
|
||||||
write(STDOUT_FILENO, "\b \b", 3);
|
write(STDOUT_FILENO, "\b \b", 3);
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue