summaryrefslogtreecommitdiff
path: root/lib/readline/complete.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2013-08-12 19:18:42 -0400
committerChet Ramey <chet.ramey@case.edu>2013-08-12 19:18:42 -0400
commit1442f67c408e60769ff344f9e4c05104e2cef7d0 (patch)
tree6c093574f9b9342f172a8d8367aa9a5849cd4d85 /lib/readline/complete.c
parent25eee30b53c60c43b155880820d29c84928847ca (diff)
downloadbash-4.3-beta.tar.gz
bash-4.3-beta overlaybash-4.3-beta
Diffstat (limited to 'lib/readline/complete.c')
-rw-r--r--lib/readline/complete.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/readline/complete.c b/lib/readline/complete.c
index 7e6700a8..31f03f7b 100644
--- a/lib/readline/complete.c
+++ b/lib/readline/complete.c
@@ -2132,13 +2132,17 @@ rl_completion_matches (text, entry_function)
xfree (match_list);
match_list = 0;
match_list_size = 0;
+ matches = 0;
RL_CHECK_SIGNALS ();
}
- if (matches + 1 == match_list_size)
+ if (matches + 1 >= match_list_size)
match_list = (char **)xrealloc
(match_list, ((match_list_size += 10) + 1) * sizeof (char *));
+ if (match_list == 0)
+ return (match_list);
+
match_list[++matches] = string;
match_list[matches + 1] = (char *)NULL;
}