Skip to content

Commit

Permalink
Fix for defect jline#4
Browse files Browse the repository at this point in the history
  • Loading branch information
Tal Salmona committed Feb 12, 2012
1 parent 77c068a commit 0f9ba7a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/jline/WindowsTerminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,20 @@ private void loadLibrary(final String name) throws IOException {
}

version = version.replace('.', '_');

File f = new File(System.getProperty("java.io.tmpdir"), name + "_"
+ version + ".dll");
boolean exists = f.isFile(); // check if it already exists


// extract the embedded jline.dll file from the jar and save
// it to the current directory
int bits = 32;

// check for 64-bit systems and use to appropriate DLL
if (System.getProperty("os.arch").indexOf("64") != -1)
bits = 64;
bits = 64;

File f = new File(System.getProperty("java.io.tmpdir"), name + "_"
+ version + "_" + bits + ".dll");

boolean exists = f.isFile(); // check if it already exists


InputStream in = new BufferedInputStream(WindowsTerminal.class.getResourceAsStream(name + bits + ".dll"));

Expand Down

0 comments on commit 0f9ba7a

Please sign in to comment.