Commit 6062a040 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Limiting the selected file to the available ones in the list.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5273 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 0 deletions
+9 -0
2015-06-28 Benno Schulenberg <bensberg@justemail.net>
* src/browser.c (browser_refresh): Limit the selected file to the
available ones in the list -- after a refresh the number may have
decreased. This fixes Savannah bug #45424.
2015-06-27 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_undo, add_undo): Skip undoing a backspace *only* when
it really tried to delete the final, magic newline.
......
......@@ -565,6 +565,10 @@ void browser_refresh(void)
browser_init(path_save, opendir(path_save));
qsort(filelist, filelist_len, sizeof(char *), diralphasort);
/* Make sure the selected file is within range. */
if (selected >= filelist_len)
selected = filelist_len - 1;
titlebar(path_save);
blank_edit();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment