change `read -d' on a tty when the delimiter is not a newline to set the terminal EOL character instead of putting the terminal into character-at-a-time mode; change some calls to atoi to use strol instead

This commit is contained in:
Chet Ramey
2026-01-30 16:43:46 -05:00
parent b805bbec80
commit 468e98e574
34 changed files with 504 additions and 2161 deletions
+5 -3
View File
@@ -1,6 +1,6 @@
/* eval.c -- reading and evaluating commands. */
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -385,6 +385,7 @@ read_command (void)
SHELL_VAR *tmout_var;
int tmout_len, result;
SigHandler *old_alrm;
char *t, *e;
set_current_prompt_level (1);
global_command = (COMMAND *)NULL;
@@ -400,8 +401,9 @@ read_command (void)
if (tmout_var && var_isset (tmout_var))
{
tmout_len = atoi (value_cell (tmout_var));
if (tmout_len > 0)
t = value_cell (tmout_var);
tmout_len = (int)strtol (t, &e, 10);
if (e != t && *e == '\0' && tmout_len > 0)
{
old_alrm = set_signal_handler (SIGALRM, alrm_catcher);
alarm (tmout_len);