summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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));