summaryrefslogtreecommitdiff
path: root/bashline.c
diff options
context:
space:
mode:
Diffstat (limited to 'bashline.c')
-rw-r--r--bashline.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bashline.c b/bashline.c
index c8741517..8ff17963 100644
--- a/bashline.c
+++ b/bashline.c
@@ -1468,10 +1468,23 @@ attempt_shell_completion (text, start, end)
os = start;
n = 0;
+ was_assignment = 0;
s = find_cmd_start (os);
e = find_cmd_end (end);
do
{
+ /* Don't read past the end of rl_line_buffer */
+ if (s > rl_end)
+ {
+ s1 = s = e1;
+ break;
+ }
+ /* Or past point if point is within an assignment statement */
+ else if (was_assignment && s > rl_point)
+ {
+ s1 = s = e1;
+ break;
+ }
/* Skip over assignment statements preceding a command name. If we
don't find a command name at all, we can perform command name
completion. If we find a partial command name, we should perform