summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2006-07-23 00:07:11 +0000
committerAntoine Cellerier <dionoea@videolan.org>2006-07-23 00:07:11 +0000
commit9ab9b6e954ff26952a4f69001e164cfa8b62e272 (patch)
tree4660bb6b6b119ff3e107a51e26ddfdbe460d07cb /apps
parentebfb4f3ab2b0e832ee336ca99f5787536f12af59 (diff)
downloadrockbox-9ab9b6e954ff26952a4f69001e164cfa8b62e272.tar.gz
rockbox-9ab9b6e954ff26952a4f69001e164cfa8b62e272.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/rockpaint.c9
1 files 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 )
646 d = rb->PREFIX(opendir)( bbuf ); 646 d = rb->PREFIX(opendir)( bbuf );
647 if( !d ) 647 if( !d )
648 { 648 {
649 /*
649 if( errno == ENOTDIR ) 650 if( errno == ENOTDIR )
650 { 651 {*/
651 /* this is a file */ 652 /* this is a file */
652 bbuf[rb->strlen(bbuf)-1] = '\0'; 653 bbuf[rb->strlen(bbuf)-1] = '\0';
653 rb->strncpy( dst, bbuf, dst_size ); 654 rb->strncpy( dst, bbuf, dst_size );
654 return true; 655 return true;
655 } 656 /*}
656 else if( errno == EACCES || errno == ENOENT ) 657 else if( errno == EACCES || errno == ENOENT )
657 { 658 {
658 bbuf[0] = '/'; bbuf[1] = '\0'; 659 bbuf[0] = '/'; bbuf[1] = '\0';
@@ -661,7 +662,7 @@ static bool browse( char *dst, int dst_size, const char *start )
661 else 662 else
662 { 663 {
663 return false; 664 return false;
664 } 665 }*/
665 } 666 }
666 top_inside = draw_window( HEIGHT, WIDTH, &top, &left, bbuf ); 667 top_inside = draw_window( HEIGHT, WIDTH, &top, &left, bbuf );
667 i = 0; 668 i = 0;
@@ -2158,7 +2159,7 @@ static void draw_toolbars(bool update)
2158 2159
2159static void toolbar( void ) 2160static void toolbar( void )
2160{ 2161{
2161 unsigned int button, i, j; 2162 int button, i, j;
2162 restore_screen(); 2163 restore_screen();
2163 draw_toolbars( false ); 2164 draw_toolbars( false );
2164 y = LCD_HEIGHT-TB_HEIGHT/2; 2165 y = LCD_HEIGHT-TB_HEIGHT/2;