diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2014-12-09 23:20:00 +0100 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2014-12-09 23:20:00 +0100 |
| commit | a2136a811f912ac5d7a4f7f07a5c303fac6051a2 (patch) | |
| tree | 4655f5f4846ffec0f2b6a88f03fc7475d31d2b92 | |
| parent | 9454ad4c9780230667a7f32d2b8b201342509d91 (diff) | |
| download | rockbox-a2136a811f912ac5d7a4f7f07a5c303fac6051a2.zip rockbox-a2136a811f912ac5d7a4f7f07a5c303fac6051a2.tar.gz rockbox-a2136a811f912ac5d7a4f7f07a5c303fac6051a2.tar.bz2 rockbox-a2136a811f912ac5d7a4f7f07a5c303fac6051a2.tar.xz | |
ypr0: Get it up and running again
7d1a47cf13 introduced a regression that broke it completely so that
it couldn't boot into the main menu anymore. It had a faulty call to
get_volume_name() which made handle_special_links() act up. This broke
every open() and opendir() (and friends) library calls.
Change-Id: I399960ca8fb6e3bcc1f25c9b4a3c19a6d28b77bd
| -rw-r--r-- | firmware/target/hosted/filesystem-app.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/firmware/target/hosted/filesystem-app.c b/firmware/target/hosted/filesystem-app.c index 93fadc6..d737047 100644 --- a/firmware/target/hosted/filesystem-app.c +++ b/firmware/target/hosted/filesystem-app.c @@ -69,18 +69,22 @@ static const char *handle_special_links(const char* link, unsigned flags, { (void) flags; char vol_string[VOL_MAX_LEN + 1]; - int len = get_volume_name(-1, vol_string); + int len; - /* link might be passed with or without HOME_DIR expanded. To handle - * both perform substring matching (VOL_NAMES is unique enough) */ - const char *begin = strstr(link, vol_string); - if (begin) + for (int i = 1; i < NUM_VOLUMES; i++) { - /* begin now points to the start of vol_string within link, - * we want to copy the remainder of the paths, prefixed by - * the actual mount point (the remainder might be "") */ - snprintf(buf, bufsize, MULTIDRIVE_DIR"%s", begin + len); - return buf; + len = get_volume_name(i, vol_string); + /* link might be passed with or without HOME_DIR expanded. To handle + * both perform substring matching (VOL_NAMES is unique enough) */ + const char *begin = strstr(link, vol_string); + if (begin) + { + /* begin now points to the start of vol_string within link, + * we want to copy the remainder of the paths, prefixed by + * the actual mount point (the remainder might be "") */ + snprintf(buf, bufsize, MULTIDRIVE_DIR"%s", begin + len); + return buf; + } } return link; |