From 2b1ab1df504819447650341372488f6bace20dde Mon Sep 17 00:00:00 2001 From: biver Date: Fri, 3 Dec 2021 11:18:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D1=8F=D0=B5=D0=BC=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20?= =?UTF-8?q?=D0=B2=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8=D1=82=D0=BC=D0=B5?= =?UTF-8?q?=20=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=B8=D1=80?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=B8.=20openNextFile()=20?= =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/FSEditor.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/FSEditor.cpp b/src/FSEditor.cpp index 98be53cd..d7708c57 100644 --- a/src/FSEditor.cpp +++ b/src/FSEditor.cpp @@ -184,21 +184,22 @@ void FSEditor::getDirList(const String &path, String &output) { } #else void FSEditor::getDirList(const String &path, String &output) { - auto dir = _fs.open(path, FILE_READ); + File dir = _fs.open(path.c_str(), FILE_READ); dir.rewindDirectory(); - while (dir.openNextFile()) { - String fname = dir.name(); - if (!path.endsWith("/") && !fname.startsWith("/")) { - fname = "/" + fname; - } - fname = path + fname; - if (isExcluded(_fs, fname.c_str())) { - continue; - } - if (dir.isDirectory()) { - getDirList(fname, output); - continue; - } + File file; + while (file = dir.openNextFile()) { + String fname = file.name(); + //if (!path.endsWith("/") && !fname.startsWith("/")) { + // fname = "/" + fname; + //} + //fname = path + fname; + //if (isExcluded(_fs, fname.c_str())) { + // continue; + //} + //if (dir.isDirectory()) { + // getDirList(fname, output); + // continue; + //} if (output != "[") output += ','; char buf[128]; sprintf(buf, "{\"type\":\"file\",\"name\":\"%s\",\"size\":%d}", fname.c_str(), dir.size());