changes to make EOF state available to readline applications; fix for command substitution parsing inside conditional command

This commit is contained in:
Chet Ramey
2022-02-21 10:06:44 -05:00
parent 6d69b62547
commit e7a56619a2
14 changed files with 140 additions and 43 deletions
+7 -1
View File
@@ -1,6 +1,6 @@
/* callback.c -- functions to use readline as an X `callback' mechanism. */
/* Copyright (C) 1987-2017 Free Software Foundation, Inc.
/* Copyright (C) 1987-2022 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -136,6 +136,8 @@ rl_callback_read_char (void)
abort ();
}
eof = 0;
memcpy ((void *)olevel, (void *)_rl_top_level, sizeof (procenv_t));
#if defined (HAVE_POSIX_SIGSETJMP)
jcode = sigsetjmp (_rl_top_level, 0);
@@ -276,6 +278,10 @@ rl_callback_read_char (void)
_rl_want_redisplay = 0;
}
/* Make sure application hooks can see whether we saw EOF. */
if (rl_eof_found = eof)
RL_SETSTATE(RL_STATE_EOF);
if (rl_done)
{
line = readline_internal_teardown (eof);