mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-11 22:20:49 +02:00
commit bash-20091124 snapshot
This commit is contained in:
@@ -1038,7 +1038,8 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
|
||||
{
|
||||
_rl_interrupt_immediately++;
|
||||
matches = (*rl_attempted_completion_function) (text, start, end);
|
||||
_rl_interrupt_immediately--;
|
||||
if (_rl_interrupt_immediately > 0)
|
||||
_rl_interrupt_immediately--;
|
||||
|
||||
if (matches || rl_attempted_completion_over)
|
||||
{
|
||||
@@ -1929,7 +1930,8 @@ rl_completion_matches (text, entry_function)
|
||||
match_list[++matches] = string;
|
||||
match_list[matches + 1] = (char *)NULL;
|
||||
}
|
||||
_rl_interrupt_immediately--;
|
||||
if (_rl_interrupt_immediately > 0)
|
||||
_rl_interrupt_immediately--;
|
||||
|
||||
/* If there were any matches, then look through them finding out the
|
||||
lowest common denominator. That then becomes match_list[0]. */
|
||||
|
||||
@@ -1038,7 +1038,8 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
|
||||
{
|
||||
_rl_interrupt_immediately++;
|
||||
matches = (*rl_attempted_completion_function) (text, start, end);
|
||||
_rl_interrupt_immediately--;
|
||||
if (_rl_interrupt_immediately)
|
||||
_rl_interrupt_immediately--;
|
||||
|
||||
if (matches || rl_attempted_completion_over)
|
||||
{
|
||||
@@ -1570,7 +1571,7 @@ insert_match (match, start, mtype, qc)
|
||||
{
|
||||
char *replacement, *r;
|
||||
char oqc;
|
||||
int end;
|
||||
int end, rlen;
|
||||
|
||||
oqc = qc ? *qc : '\0';
|
||||
replacement = make_quoted_replacement (match, mtype, qc);
|
||||
@@ -1578,6 +1579,7 @@ insert_match (match, start, mtype, qc)
|
||||
/* Now insert the match. */
|
||||
if (replacement)
|
||||
{
|
||||
rlen = strlen (replacement);
|
||||
/* Don't double an opening quote character. */
|
||||
if (qc && *qc && start && rl_line_buffer[start - 1] == *qc &&
|
||||
replacement[0] == *qc)
|
||||
@@ -1588,6 +1590,9 @@ insert_match (match, start, mtype, qc)
|
||||
replacement[0] != oqc)
|
||||
start--;
|
||||
end = rl_point - 1;
|
||||
/* Don't double a closing quote character */
|
||||
if (qc && *qc && end && rl_line_buffer[rl_point] == *qc && replacement[rlen - 1] == *qc)
|
||||
end++;
|
||||
if (_rl_skip_completed_text)
|
||||
{
|
||||
r = replacement;
|
||||
@@ -1925,7 +1930,8 @@ rl_completion_matches (text, entry_function)
|
||||
match_list[++matches] = string;
|
||||
match_list[matches + 1] = (char *)NULL;
|
||||
}
|
||||
_rl_interrupt_immediately--;
|
||||
if (_rl_interrupt_immediately)
|
||||
_rl_interrupt_immediately--;
|
||||
|
||||
/* If there were any matches, then look through them finding out the
|
||||
lowest common denominator. That then becomes match_list[0]. */
|
||||
|
||||
@@ -142,13 +142,14 @@ static RETSIGTYPE
|
||||
rl_signal_handler (sig)
|
||||
int sig;
|
||||
{
|
||||
if (_rl_interrupt_immediately)
|
||||
if (_rl_interrupt_immediately || RL_ISSTATE(RL_STATE_CALLBACK))
|
||||
{
|
||||
_rl_interrupt_immediately = 0;
|
||||
_rl_handle_signal (sig);
|
||||
}
|
||||
else
|
||||
_rl_caught_signal = sig;
|
||||
|
||||
_rl_caught_signal = sig;
|
||||
SIGHANDLER_RETURN;
|
||||
}
|
||||
|
||||
|
||||
+60
-3
@@ -101,7 +101,8 @@ int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */
|
||||
int _rl_interrupt_immediately = 0;
|
||||
int volatile _rl_caught_signal = 0; /* should be sig_atomic_t, but that requires including <signal.h> everywhere */
|
||||
|
||||
/* If non-zero, print characters corresponding to received signals. */
|
||||
/* If non-zero, print characters corresponding to received signals as long as
|
||||
the user has indicated his desire to do so (_rl_echo_control_chars). */
|
||||
int _rl_echoctl = 0;
|
||||
|
||||
int _rl_intr_char = 0;
|
||||
@@ -146,8 +147,9 @@ rl_signal_handler (sig)
|
||||
_rl_interrupt_immediately = 0;
|
||||
_rl_handle_signal (sig);
|
||||
}
|
||||
else
|
||||
_rl_caught_signal = sig;
|
||||
|
||||
_rl_caught_signal = sig;
|
||||
SIGHANDLER_RETURN;
|
||||
}
|
||||
|
||||
@@ -518,13 +520,16 @@ rl_free_line_state ()
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
static sigset_t sigint_set, sigint_oset;
|
||||
static sigset_t sigwinch_set, sigwinch_oset;
|
||||
#else /* !HAVE_POSIX_SIGNALS */
|
||||
# if defined (HAVE_BSD_SIGNALS)
|
||||
static int sigint_oldmask;
|
||||
static int sigwinch_oldmask;
|
||||
# endif /* HAVE_BSD_SIGNALS */
|
||||
#endif /* !HAVE_POSIX_SIGNALS */
|
||||
|
||||
static int sigint_blocked;
|
||||
static int sigwinch_blocked;
|
||||
|
||||
/* Cause SIGINT to not be delivered until the corresponding call to
|
||||
release_sigint(). */
|
||||
@@ -574,6 +579,54 @@ _rl_release_sigint ()
|
||||
sigint_blocked = 0;
|
||||
}
|
||||
|
||||
/* Cause SIGWINCH to not be delivered until the corresponding call to
|
||||
release_sigwinch(). */
|
||||
void
|
||||
_rl_block_sigwinch ()
|
||||
{
|
||||
if (sigwinch_blocked)
|
||||
return;
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
sigemptyset (&sigwinch_set);
|
||||
sigemptyset (&sigwinch_oset);
|
||||
sigaddset (&sigwinch_set, SIGWINCH);
|
||||
sigprocmask (SIG_BLOCK, &sigwinch_set, &sigwinch_oset);
|
||||
#else /* !HAVE_POSIX_SIGNALS */
|
||||
# if defined (HAVE_BSD_SIGNALS)
|
||||
sigwinch_oldmask = sigblock (sigmask (SIGWINCH));
|
||||
# else /* !HAVE_BSD_SIGNALS */
|
||||
# if defined (HAVE_USG_SIGHOLD)
|
||||
sighold (SIGWINCH);
|
||||
# endif /* HAVE_USG_SIGHOLD */
|
||||
# endif /* !HAVE_BSD_SIGNALS */
|
||||
#endif /* !HAVE_POSIX_SIGNALS */
|
||||
|
||||
sigwinch_blocked = 1;
|
||||
}
|
||||
|
||||
/* Allow SIGWINCH to be delivered. */
|
||||
void
|
||||
_rl_release_sigwinch ()
|
||||
{
|
||||
if (sigwinch_blocked == 0)
|
||||
return;
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
sigprocmask (SIG_SETMASK, &sigwinch_oset, (sigset_t *)NULL);
|
||||
#else
|
||||
# if defined (HAVE_BSD_SIGNALS)
|
||||
sigsetmask (sigwinch_oldmask);
|
||||
# else /* !HAVE_BSD_SIGNALS */
|
||||
# if defined (HAVE_USG_SIGHOLD)
|
||||
sigrelse (SIGWINCH);
|
||||
# endif /* HAVE_USG_SIGHOLD */
|
||||
# endif /* !HAVE_BSD_SIGNALS */
|
||||
#endif /* !HAVE_POSIX_SIGNALS */
|
||||
|
||||
sigwinch_blocked = 0;
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Echoing special control characters */
|
||||
@@ -586,14 +639,18 @@ rl_echo_signal_char (sig)
|
||||
char cstr[3];
|
||||
int cslen, c;
|
||||
|
||||
if (_rl_echoctl == 0)
|
||||
if (_rl_echoctl == 0 || _rl_echo_control_chars == 0)
|
||||
return;
|
||||
|
||||
switch (sig)
|
||||
{
|
||||
case SIGINT: c = _rl_intr_char; break;
|
||||
#if defined (SIGQUIT)
|
||||
case SIGQUIT: c = _rl_quit_char; break;
|
||||
#endif
|
||||
#if defined (SIGTSTP)
|
||||
case SIGTSTP: c = _rl_susp_char; break;
|
||||
#endif
|
||||
default: return;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -81,8 +81,7 @@ rl_alphabetic (c)
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
int
|
||||
_rl_walphabetic (wc)
|
||||
wchar_t wc;
|
||||
_rl_walphabetic (wchar_t wc)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ rl_abort (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
_rl_null_func (count, key)
|
||||
_rl_null_function (count, key)
|
||||
int count, key;
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user