- files.c:input_tab() - Fix assumption that matches is null terminated (David Benbennick)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1431 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2003-02-08 02:02:02 +00:00
parent 17ec14b9a5
commit 3cdf6ff1de
2 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,10 @@ CVS code
- Translation updates (see po/ChangeLog for details).
- Fix globals and externs such that nano will compile with
DISABLE_SPELLER (David Benbennick).
- files.c:
intput_tab()
- Fix assumption that matches is null terminated (David
Benbennick).
- nano.c:
main()
- Fix nano not compiling with ENABLE_RCFILE and DISABLE_TABCOMP

View File

@ -2116,6 +2116,8 @@ char **cwd_tab_completion(char *buf, int *num_matches)
break;
}
}
closedir(dir);
free(dirname);
return matches;
}
@ -2312,7 +2314,7 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
/* 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) {