mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Sketch: read-only files were overwritten in case of successful "save as". Fixes #3678
This commit is contained in:
parent
695fc40fbd
commit
985244ab19
@ -561,13 +561,12 @@ public class Sketch {
|
||||
//if (!modified) return false;
|
||||
|
||||
if (isReadOnly(BaseNoGui.librariesIndexer.getInstalledLibraries(), BaseNoGui.getExamplesPath())) {
|
||||
// if the files are read-only, need to first do a "save as".
|
||||
Base.showMessage(tr("Sketch is read-only"),
|
||||
tr("Some files are marked \"read-only\", so you'll\n" +
|
||||
"need to re-save this sketch to another location."));
|
||||
// if the user cancels, give up on the save()
|
||||
if (!saveAs()) return false;
|
||||
} else {
|
||||
return saveAs();
|
||||
}
|
||||
|
||||
// rename .pde files to .ino
|
||||
File mainFile = new File(getMainFilePath());
|
||||
File mainFolder = mainFile.getParentFile();
|
||||
@ -604,7 +603,6 @@ public class Sketch {
|
||||
renameCodeToInoExtension(pdeFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data.save();
|
||||
calcModified();
|
||||
|
Loading…
x
Reference in New Issue
Block a user