Sync with bash 1.4.5 version
Check some null pointers before action, cosmetique fixes Submitted by: Obtained from:
This commit is contained in:
parent
e9857eee2b
commit
5d633ee823
@ -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)
|
||||
|
@ -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++)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user