mirror of https://github.com/noisymime/Arduino.git
Importing a subfolder of the sketchbook or importing a folder that contains the sketchbook is now blocked. Fixes #2795
This commit is contained in:
parent
5875909683
commit
3ecaf665ae
|
@ -2471,8 +2471,17 @@ public class Base {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// is there a valid library?
|
|
||||||
File libFolder = sourceFile;
|
File libFolder = sourceFile;
|
||||||
|
if (FileUtils.isSubDirectory(new File(PreferencesData.get("sketchbook.path")), libFolder)) {
|
||||||
|
activeEditor.statusError(_("A subfolder of your sketchbook is not a valid library"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FileUtils.isSubDirectory(libFolder, new File(PreferencesData.get("sketchbook.path")))) {
|
||||||
|
activeEditor.statusError(_("You can't import a folder that contains your sketchbook"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String libName = libFolder.getName();
|
String libName = libFolder.getName();
|
||||||
if (!BaseNoGui.isSanitaryName(libName)) {
|
if (!BaseNoGui.isSanitaryName(libName)) {
|
||||||
String mess = I18n.format(_("The library \"{0}\" cannot be used.\n"
|
String mess = I18n.format(_("The library \"{0}\" cannot be used.\n"
|
||||||
|
|
Loading…
Reference in New Issue