From 9ab9b6e954ff26952a4f69001e164cfa8b62e272 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Sun, 23 Jul 2006 00:07:11 +0000 Subject: Fix file browser (which fixes file loading from menu). Looks like errno isn't set as expected when using opendir on real targets. Btw, i forgot to give credit to Eli Sherer for the original rockpaint idea and code in my previous commit. Thanks :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10288 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/rockpaint.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index 7ca4cb50f8..77259e4fbb 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c @@ -646,13 +646,14 @@ static bool browse( char *dst, int dst_size, const char *start ) d = rb->PREFIX(opendir)( bbuf ); if( !d ) { + /* if( errno == ENOTDIR ) - { + {*/ /* this is a file */ bbuf[rb->strlen(bbuf)-1] = '\0'; rb->strncpy( dst, bbuf, dst_size ); return true; - } + /*} else if( errno == EACCES || errno == ENOENT ) { bbuf[0] = '/'; bbuf[1] = '\0'; @@ -661,7 +662,7 @@ static bool browse( char *dst, int dst_size, const char *start ) else { return false; - } + }*/ } top_inside = draw_window( HEIGHT, WIDTH, &top, &left, bbuf ); i = 0; @@ -2158,7 +2159,7 @@ static void draw_toolbars(bool update) static void toolbar( void ) { - unsigned int button, i, j; + int button, i, j; restore_screen(); draw_toolbars( false ); y = LCD_HEIGHT-TB_HEIGHT/2; -- cgit v1.2.3