mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-07 04:10:49 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user