mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Fix --curdir on Windows
On Windows, files are canonicalized to prevent issues with legacy 8.3 filenames. However, this canonicalization includes making the path absolute and this happened before applying --curdir to the path, making the latter a noop. By reversing the operations, this should allow both of them to do their work.
This commit is contained in:
parent
31fe4ac0c2
commit
f96d71f32d
@ -456,22 +456,21 @@ public class Base {
|
||||
showError(null, _("--verbose, --verbose-upload and --verbose-build can only be used together with --verify or --upload"), 3);
|
||||
|
||||
for (String path: filenames) {
|
||||
// Correctly resolve relative paths
|
||||
File file = absoluteFile(path);
|
||||
|
||||
// Fix a problem with systems that use a non-ASCII languages. Paths are
|
||||
// being passed in with 8.3 syntax, which makes the sketch loader code
|
||||
// unhappy, since the sketch folder naming doesn't match up correctly.
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=1089
|
||||
if (isWindows()) {
|
||||
try {
|
||||
File file = new File(path);
|
||||
path = file.getCanonicalPath();
|
||||
file = file.getCanonicalFile();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// Correctly resolve relative paths
|
||||
File file = absoluteFile(path);
|
||||
|
||||
boolean showEditor = (action == ACTION.GUI);
|
||||
if (handleOpen(file, nextEditorLocation(), showEditor) == null) {
|
||||
String mess = I18n.format(_("Failed to open sketch: \"{0}\""), path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user