nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 3cdf6ff1de6f446a3103d91e1122cec8df78c79b
parent 17ec14b9a53ce66487bd456fdaba9d5ee290c2f4
Author: Chris Allegretta <chrisa@asty.org>
Date:   Sat,  8 Feb 2003 02:02:02 +0000

- 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

Diffstat:
MChangeLog | 4++++
Mfiles.c | 4+++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -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 diff --git a/files.c b/files.c @@ -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) {