[FileChoice] eject duplicates

This commit is contained in:
Raphael Coeffic
2021-07-13 08:42:34 +02:00
parent 0b7b48a1e1
commit 3f6f488180
+6 -1
View File
@@ -80,7 +80,12 @@ bool FileChoice::openMenu()
if (!fnLen || fnLen > maxlen) continue; // wrong size
files.emplace_back(fno.fname, fnLen);
// eject duplicates
std::string newFile(fno.fname, fnLen);
if (std::find(files.begin(), files.end(), newFile) != files.end())
continue;
files.emplace_back(newFile);
}
if (!files.empty()) {