Permalink
Browse files

If a bug exists in Maker, there is a decent chance an equivalent bug …

…exists in Stroyent. We hold this truth to be self-evident.
  • Loading branch information...
JohnEarnest committed Jul 5, 2012
1 parent d8cd6ab commit 5388d5782050b5eb4a43c013cbe47403d506d2f6
Showing with 10 additions and 6 deletions.
  1. +10 −6 tools/Stroyent/src/SPC.java
@@ -1,5 +1,6 @@
import java.io.*;
import java.util.*;
+import java.net.*;
// The Stroyent Processing Compiler
@@ -141,12 +142,15 @@ else if (cursor.match("const")) {
}
else if (cursor.match("include")) {
if (cursor.match("<")) {
- String libPath = new File(SPC.class.getProtectionDomain()
- .getCodeSource().getLocation().getPath()).getParent();
- currentPath.push(libPath + "/../lib/");
- compileFile(cursor.parseName() + ".snt");
- currentPath.pop();
- cursor.expect('>');
+ try {
+ String libPath = URLDecoder.decode(new File(SPC.class.getProtectionDomain()
+ .getCodeSource().getLocation().getPath()).getParent(), "UTF-8");
+ currentPath.push(libPath + "/../lib/");
+ compileFile(cursor.parseName() + ".snt");
+ currentPath.pop();
+ cursor.expect('>');
+ }
+ catch(UnsupportedEncodingException e) { e.printStackTrace(); }
}
else {
compileFile(cursor.parseString());

0 comments on commit 5388d57

Please sign in to comment.