diff -u nano/files.c nano-tab/files.c --- nano/files.c Thu Feb 6 18:31:21 2003 +++ nano-tab/files.c Thu Feb 6 18:33:39 2003 @@ -2116,6 +2116,8 @@ break; } } + closedir(dir); + free(dirname); return matches; } @@ -2312,7 +2314,7 @@ /* And if the next match isn't going to fit on the line, move to the next one */ - if (col > (COLS - longestname) && matches[i + 1] != NULL) { + if (col > COLS - longestname && i + 1 < num_matches) { editline++; wmove(edit, editline, 0); if (editline == editwinrows - 1) {