diff options
| author | Chet Ramey <chet.ramey@case.edu> | 2013-08-12 19:18:42 -0400 |
|---|---|---|
| committer | Chet Ramey <chet.ramey@case.edu> | 2013-08-12 19:18:42 -0400 |
| commit | 1442f67c408e60769ff344f9e4c05104e2cef7d0 (patch) | |
| tree | 6c093574f9b9342f172a8d8367aa9a5849cd4d85 /lib/readline/complete.c | |
| parent | 25eee30b53c60c43b155880820d29c84928847ca (diff) | |
| download | bash-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.c | 6 |
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; } |
