From 785e0c4c62caafb7394f083c263d72230b32f84f Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Tue, 20 Feb 2024 18:41:23 +0000 Subject: [PATCH] AP_ROMFS: don't require / in filename --- libraries/AP_ROMFS/AP_ROMFS.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/AP_ROMFS/AP_ROMFS.cpp b/libraries/AP_ROMFS/AP_ROMFS.cpp index 67adb2313c..84db219489 100644 --- a/libraries/AP_ROMFS/AP_ROMFS.cpp +++ b/libraries/AP_ROMFS/AP_ROMFS.cpp @@ -117,8 +117,7 @@ const char *AP_ROMFS::dir_list(const char *dirname, uint16_t &ofs) { const size_t dlen = strlen(dirname); for ( ; ofs < ARRAY_SIZE(files); ofs++) { - if (strncmp(dirname, files[ofs].filename, dlen) == 0 && - files[ofs].filename[dlen] == '/') { + if ((dlen == 0) || (strncmp(dirname, files[ofs].filename, dlen) == 0)) { // found one return files[ofs++].filename; }