summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-11-29 12:51:44 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-11-29 12:51:44 +0000
commit47f670d3c27cd0eb93ddbff91c9f6a60febcbf27 (patch)
treebe0cff17e8b36b4f44921fa64f2cdb2d3e9c85b7
parent4fd775f7f0f5e6c7f2fd277ea0889afecef191e7 (diff)
downloadrockbox-47f670d3c27cd0eb93ddbff91c9f6a60febcbf27.tar.gz
rockbox-47f670d3c27cd0eb93ddbff91c9f6a60febcbf27.tar.bz2
rockbox-47f670d3c27cd0eb93ddbff91c9f6a60febcbf27.zip
FS#11725: fix duplicationg slash indicating root in filename.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28705 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playlist.c6
-rw-r--r--apps/recorder/recording.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index a50dac69cf..f56603749a 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -3536,7 +3536,8 @@ int playlist_directory_tracksearch(const char* dirname, bool recurse,
if (recurse)
{
/* recursively add directories */
- snprintf(buf, sizeof(buf), "%s/%s", dirname, files[i].name);
+ snprintf(buf, sizeof(buf), "%s/%s",
+ dirname[1]? dirname: "", files[i].name);
result = playlist_directory_tracksearch(buf, recurse,
callback, context);
if (result < 0)
@@ -3562,7 +3563,8 @@ int playlist_directory_tracksearch(const char* dirname, bool recurse,
}
else if ((files[i].attr & FILE_ATTR_MASK) == FILE_ATTR_AUDIO)
{
- snprintf(buf, sizeof(buf), "%s/%s", dirname, files[i].name);
+ snprintf(buf, sizeof(buf), "%s/%s",
+ dirname[1]? dirname: "", files[i].name);
if (callback(buf, context) != 0)
{
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index fdeae03f9b..d5db373717 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -621,7 +621,8 @@ char *rec_create_filename(char *buffer)
pref = prestr[global_settings.rec_source];
}
- strcpy(buffer, global_settings.rec_directory);
+ strcpy(buffer, !strcmp(global_settings.rec_directory, "/")?
+ "": global_settings.rec_directory);
snprintf(ext, sizeof(ext), ".%s",
REC_FILE_ENDING(global_settings.rec_format));