Commit 015c434b authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

cosmetic fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3735 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 2 additions and 8 deletions
+2 -8
......@@ -92,7 +92,7 @@ char *do_browser(char *path, DIR *dir)
titlebar(path);
while (!abort) {
size_t fileline;
size_t fileline = (width != 0) ? selected / width : selected;
/* The line number the selected file is on. */
size_t old_selected = selected;
/* The selected file we had before the current selected
......@@ -112,12 +112,6 @@ char *do_browser(char *path, DIR *dir)
prev_dir = NULL;
}
/* Calculate the line number we're on now, so that we don't
* divide by zero. */
fileline = selected;
if (width != 0)
fileline /= width;
switch (kbinput) {
#ifndef DISABLE_MOUSE
case KEY_MOUSE:
......@@ -192,7 +186,7 @@ char *do_browser(char *path, DIR *dir)
case NANO_NEXTPAGE_KEY:
selected += (editwinrows - fileline % editwinrows) *
width;
if (selected >= filelist_len)
if (selected > filelist_len - 1)
selected = filelist_len - 1;
break;
case NANO_FIRSTFILE_ALTKEY:
......
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