fish: Don't segfault here is 'words' happens to be NULL (found by Coverity).

This commit is contained in:
Richard W.M. Jones
2012-12-08 14:42:58 +00:00
parent 40bfce7629
commit 489cb059c2

View File

@@ -214,7 +214,8 @@ complete_dest_paths_generator (const char *text, int state)
rl_attempted_completion_over = 1;
/* Sort the words so the list is stable over multiple calls. */
qsort (words, nr_words, sizeof (struct word), compare_words);
if (words)
qsort (words, nr_words, sizeof (struct word), compare_words);
/* Complete the string. */
while (index < nr_words) {