From 5d633ee823362f586f0f6a038cd7cfd36d074a2d Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 19 Jul 1995 17:01:18 +0000 Subject: [PATCH] Sync with bash 1.4.5 version Check some null pointers before action, cosmetique fixes Submitted by: Obtained from: --- gnu/lib/libreadline/complete.c | 4 ++-- gnu/lib/libreadline/display.c | 2 +- gnu/lib/libreadline/readline.3 | 4 +--- gnu/lib/libreadline/readline.c | 10 +++++----- gnu/lib/libreadline/vi_mode.c | 18 +++++++++--------- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/gnu/lib/libreadline/complete.c b/gnu/lib/libreadline/complete.c index 4726079f4d11..2ef001cf8479 100644 --- a/gnu/lib/libreadline/complete.c +++ b/gnu/lib/libreadline/complete.c @@ -468,7 +468,7 @@ rl_complete_internal (what_to_do) } } - if (rl_point == end) + if (rl_point == end && found_quote == 0) { int quoted = 0; /* We didn't find an unclosed quoted substring upon which to do @@ -668,7 +668,7 @@ rl_complete_internal (what_to_do) not be checked, add !matches[1] to the if clause. */ should_quote = rl_strpbrk (matches[0], rl_completer_word_break_characters) != 0; #if defined (SHELL) - should_quote = should_quote || rl_strpbrk (matches[0], "#$`?*[") != 0; + should_quote = should_quote || rl_strpbrk (matches[0], "#$`?*[!") != 0; #endif if (should_quote) diff --git a/gnu/lib/libreadline/display.c b/gnu/lib/libreadline/display.c index fcc766c6ce35..762b5052f770 100644 --- a/gnu/lib/libreadline/display.c +++ b/gnu/lib/libreadline/display.c @@ -185,7 +185,7 @@ expand_prompt (pmt, lp) return r; } - l = strlen (pmt); + l = pmt ? strlen (pmt) : 0; r = ret = xmalloc (l + 1); for (rl = ignoring = 0, p = pmt; p && *p; p++) diff --git a/gnu/lib/libreadline/readline.3 b/gnu/lib/libreadline/readline.3 index 1df2a18b6c07..bbe9d9139542 100644 --- a/gnu/lib/libreadline/readline.3 +++ b/gnu/lib/libreadline/readline.3 @@ -95,8 +95,6 @@ char *variable, *value; .fi .LP .nf -.LP -.nf .ft B int rl_parse_and_bind (line) char *line; @@ -744,7 +742,7 @@ inserts the \fIn\fPth word from the end of the previous command. yank\-last\-arg (M\-.\^, M\-_\^) Insert the last argument to the previous command (the last word on the previous line). With an argument, -behave exactly like @code{yank-nth-arg}. +behave exactly like \fByank-nth-arg\fP. .PD .SS Commands for Changing Text .PP diff --git a/gnu/lib/libreadline/readline.c b/gnu/lib/libreadline/readline.c index 6d5dac517e23..577f53661e99 100644 --- a/gnu/lib/libreadline/readline.c +++ b/gnu/lib/libreadline/readline.c @@ -3122,7 +3122,7 @@ rl_kill_line (direction, ignore) return (rl_backward_kill_line (1)); else { - rl_end_of_line (); + rl_end_of_line (1, ignore); if (orig_point != rl_point) rl_kill_text (orig_point, rl_point); rl_point = orig_point; @@ -3145,7 +3145,7 @@ rl_backward_kill_line (direction, ignore) ding (); else { - rl_beg_of_line (); + rl_beg_of_line (1, ignore); rl_kill_text (orig_point, rl_point); } } @@ -3169,7 +3169,7 @@ rl_yank (count, ignore) { if (!rl_kill_ring) { - rl_abort (); + rl_abort (count, ignore); return -1; } @@ -3190,7 +3190,7 @@ rl_yank_pop (count, key) if (((rl_last_func != rl_yank_pop) && (rl_last_func != rl_yank)) || !rl_kill_ring) { - rl_abort (); + rl_abort (1, key); return -1; } @@ -3209,7 +3209,7 @@ rl_yank_pop (count, key) } else { - rl_abort (); + rl_abort (1, key); return -1; } } diff --git a/gnu/lib/libreadline/vi_mode.c b/gnu/lib/libreadline/vi_mode.c index b50c7079afae..8ace8922da68 100644 --- a/gnu/lib/libreadline/vi_mode.c +++ b/gnu/lib/libreadline/vi_mode.c @@ -275,7 +275,7 @@ rl_vi_complete (ignore, key) if (key == '*' || key == '\\') { _rl_vi_set_last (key, 1, rl_arg_sign); - rl_vi_insertion_mode (); + rl_vi_insertion_mode (1, key); } return (0); } @@ -286,7 +286,7 @@ rl_vi_tilde_expand (ignore, key) { rl_tilde_expand (0, key); _rl_vi_set_last (key, 1, rl_arg_sign); /* XXX */ - rl_vi_insertion_mode (); + rl_vi_insertion_mode (1, key); return (0); } @@ -507,8 +507,8 @@ rl_vi_eword (count) rl_vi_insert_beg (count, key) int count, key; { - rl_beg_of_line (); - rl_vi_insertion_mode (); + rl_beg_of_line (1, key); + rl_vi_insertion_mode (1, key); return (0); } @@ -517,15 +517,15 @@ rl_vi_append_mode (count, key) { if (rl_point < rl_end) rl_point++; - rl_vi_insertion_mode (); + rl_vi_insertion_mode (1, key); return (0); } rl_vi_append_eol (count, key) int count, key; { - rl_end_of_line (); - rl_vi_append_mode (); + rl_end_of_line (1, key); + rl_vi_append_mode (1, key); return (0); } @@ -836,7 +836,7 @@ rl_vi_change_to (count, key) rl_begin_undo_group (); _rl_vi_doing_insert = 1; _rl_vi_set_last (key, count, rl_arg_sign); - rl_vi_insertion_mode (); + rl_vi_insertion_mode (1, key); return (0); } @@ -1157,7 +1157,7 @@ rl_vi_subst (count, key) rl_begin_undo_group (); _rl_vi_doing_insert = 1; - rl_vi_insertion_mode (); + rl_vi_insertion_mode (1, key); return (0); }