Skip to content

Commit ce91178

Browse files
author
Federico Fissore
committed
Fixed bug with paths with spaces
1 parent 7f6cf5d commit ce91178

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arduino-core/src/processing/app/BaseNoGui.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.io.FileWriter;
88
import java.io.IOException;
99
import java.io.InputStream;
10+
import java.net.URISyntaxException;
1011
import java.util.*;
1112
import java.util.logging.Level;
1213
import java.util.logging.Logger;
@@ -167,7 +168,11 @@ static public File getContentFile(String name) {
167168
File path = new File(System.getProperty("user.dir"));
168169

169170
if (OSUtils.isMacOS()) {
170-
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
171+
try {
172+
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile();
173+
} catch (URISyntaxException e) {
174+
throw new RuntimeException(e);
175+
}
171176
}
172177

173178
return new File(path, name);

0 commit comments

Comments
 (0)