summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2015-08-13 15:38:31 -0400
committerChet Ramey <chet.ramey@case.edu>2015-08-13 15:38:31 -0400
commit2b3ca7e0cf54870a5861436d23d5a7b4919258e7 (patch)
tree5ff4a3c00f760f60c63f91e862f1d46a1700eb6d
parent8d98b94e3e12ad68a1101a409179dfef56e8781c (diff)
downloadbash-2b3ca7e0cf54870a5861436d23d5a7b4919258e7.tar.gz
Bash-4.3 patch 41
-rw-r--r--bashline.c13
-rw-r--r--lib/readline/complete.c2
-rw-r--r--patchlevel.h2
3 files changed, 16 insertions, 1 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
diff --git a/lib/readline/complete.c b/lib/readline/complete.c
index cd9aebe8..3d36e920 100644
--- a/lib/readline/complete.c
+++ b/lib/readline/complete.c
@@ -689,6 +689,8 @@ printable_part (pathname)
if (temp == 0 || *temp == '\0')
return (pathname);
+ else if (temp[1] == 0 && temp == pathname)
+ return (pathname);
/* If the basename is NULL, we might have a pathname like '/usr/src/'.
Look for a previous slash and, if one is found, return the portion
following that slash. If there's no previous slash, just return the
diff --git a/patchlevel.h b/patchlevel.h
index 6b73b147..44f59c77 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 40
+#define PATCHLEVEL 41
#endif /* _PATCHLEVEL_H_ */