X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=gui.c;h=9ac24ab6baddb74f8a991d770dedf609546bae09;hb=d7562ba640e30ac4bf1160509f4c2f705363d53f;hp=a4ee72758d6944cbd28aa8476049268ebb762256;hpb=f652ce6afe7f6fd0e42814505234cbf4321a736e;p=paraslash.git diff --git a/gui.c b/gui.c index a4ee7275..9ac24ab6 100644 --- a/gui.c +++ b/gui.c @@ -951,7 +951,7 @@ static int open_stat_pipe(void) return ret; } -#define COMMAND_BUF_SIZE 4096 +#define COMMAND_BUF_SIZE 32768 /* * This is the core select loop. Besides the (internal) signal @@ -993,6 +993,8 @@ repeat: if (command_fds[1] >= 0) para_fd_set(command_fds[1], &rfds, &max_fileno); } + if (mode == GETCH_MODE || mode == COMMAND_MODE) + para_fd_set(STDIN_FILENO, &rfds, &max_fileno); ret = para_select(max_fileno + 1, &rfds, NULL, &tv); if (ret <= 0) goto check_return; /* skip fd checks */ @@ -1023,6 +1025,10 @@ repeat: if (command_fds[!i] < 0) /* both fds closed */ return 0; } + if (cbo[i] == COMMAND_BUF_SIZE - 1) { + PARA_NOTICE_LOG("discarding overlong line"); + cbo[i] = 0; + } } } ret = read_stat_pipe(&rfds);