Fix FS#7387 - trying to go into the file browser when the last folder was on the MMC/mSD card (which was removed) would go into an infinite loop.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13768 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-07-03 08:43:38 +00:00
parent 7b861eca95
commit 2ca895bae7

View file

@ -34,6 +34,7 @@
#include "power.h" #include "power.h"
#include "talk.h" #include "talk.h"
#include "audio.h" #include "audio.h"
#include "hotswap.h"
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) #if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
#include "backdrop.h" #include "backdrop.h"
@ -100,6 +101,12 @@ static int browser(void* param)
{ {
strcpy(folder, wps_state.current_track_path); strcpy(folder, wps_state.current_track_path);
} }
#ifdef HAVE_HOTSWAP /* quick hack to stop crashing if you try entering
the browser from the menu when you were in the card
and it was removed */
else if (strchr(last_folder, '<') && (card_detect() == false))
strcpy(folder, "/");
#endif
else else
strcpy(folder, last_folder); strcpy(folder, last_folder);
break; break;