From f559159e2edee52d1344e821d6072d2936feab52 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Mon, 30 Dec 2019 13:16:32 +1100 Subject: [PATCH] Fixed the broken StarFileName option. --- src/iec_commands.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/iec_commands.cpp b/src/iec_commands.cpp index a20574d..5e59e77 100644 --- a/src/iec_commands.cpp +++ b/src/iec_commands.cpp @@ -2011,10 +2011,13 @@ void IEC_Commands::OpenFile() char cwd[1024]; if (f_getcwd(cwd, 1024) == FR_OK) { - if (strcasecmp(cwd, "/1541") == 0) + const char* folder = strstr(cwd, "/"); + if (folder) { - //DEBUG_LOG("use star %s\r\n", starFileName); - strncpy(filename, starFileName, sizeof(filename) - 1); + if (strcasecmp(folder, "/1541") == 0) + { + strncpy(filename, starFileName, sizeof(filename) - 1); + } } } }