diff --git a/arduino-core/src/processing/app/Sketch.java b/arduino-core/src/processing/app/Sketch.java index 3022b9cd4..11b57ab3b 100644 --- a/arduino-core/src/processing/app/Sketch.java +++ b/arduino-core/src/processing/app/Sketch.java @@ -106,7 +106,7 @@ public class Sketch { private List listSketchFiles(boolean showWarnings) throws IOException { Set result = new TreeSet<>(CODE_DOCS_COMPARATOR); for (File file : FileUtils.listFiles(folder, false, EXTENSIONS)) { - if (BaseNoGui.isSanitaryName(file.getName())) { + if (BaseNoGui.isSanitaryName(FileUtils.splitFilename(file).basename)) { result.add(new SketchFile(this, file)); } else if (showWarnings) { System.err.println(I18n.format(tr("File name {0} is invalid: ignored"), file.getName()));