From ce911788eb989939280724d5fed1b2272be7c815 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 2 Feb 2015 15:30:34 +0100 Subject: [PATCH] Fixed bug with paths with spaces --- arduino-core/src/processing/app/BaseNoGui.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index 6b5efdcf8..dd1e3527e 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -7,6 +7,7 @@ import java.io.FileInputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; +import java.net.URISyntaxException; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; @@ -167,7 +168,11 @@ public class BaseNoGui { File path = new File(System.getProperty("user.dir")); if (OSUtils.isMacOS()) { - path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile(); + try { + path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } } return new File(path, name);