summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-05-29 09:00:13 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-05-29 09:00:13 +0000
commit082ba5196db83b2eb816f787e677daf66df5b72e (patch)
tree3777928d60d704c60b4128c4f0e9cd598bfb6f83
parent349e73079e7dcde680b6a0f2fb02fa0339d6dc7a (diff)
downloadrockbox-082ba5196db83b2eb816f787e677daf66df5b72e.zip
rockbox-082ba5196db83b2eb816f787e677daf66df5b72e.tar.gz
rockbox-082ba5196db83b2eb816f787e677daf66df5b72e.tar.bz2
rockbox-082ba5196db83b2eb816f787e677daf66df5b72e.tar.xz
Don't scroll past end of file list
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@779 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tree.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/apps/tree.c b/apps/tree.c
index b0f82ce..27be52b 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -268,15 +268,17 @@ bool dirbrowse(char *root)
#else
case BUTTON_RIGHT:
#endif
- if(dircursor+1 < TREE_MAX_ON_SCREEN) {
- lcd_puts(0, LINE_Y+dircursor, " ");
- dircursor++;
- lcd_puts(0, LINE_Y+dircursor, "-");
- }
- else {
- start++;
- numentries = showdir(currdir, start);
- lcd_puts(0, LINE_Y+dircursor, "-");
+ if (dircursor + start + 1 < numentries ) {
+ if(dircursor+1 < TREE_MAX_ON_SCREEN) {
+ lcd_puts(0, LINE_Y+dircursor, " ");
+ dircursor++;
+ lcd_puts(0, LINE_Y+dircursor, "-");
+ }
+ else {
+ start++;
+ numentries = showdir(currdir, start);
+ lcd_puts(0, LINE_Y+dircursor, "-");
+ }
}
break;