Skip to content

Commit

Permalink
Attempting to fix Windows path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ASinanSaglam committed May 16, 2019
1 parent b25ddb4 commit d896f3d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/rulebender/preferences/PreferencesClerk.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,18 @@ private PreferencesClerk() {

public static String getDefaultBNGPath()
{
return Application.GetExecutionPath() + BNGPathFromRoot;
// ASS2019 - Not sure when that started happening but Eclipse
// returns an extra \ in front of the path in Windows. This
// checks and removes it if it's there. I'm not 100% sure if
// this fixes the issue entirely but it's hard to replicate
// the bug. It doesn't seem to break anything either.
String path = Application.GetExecutionPath() + BNGPathFromRoot;
if(getOS()==OS.WINDOWS) {
if(path.charAt(0) == '\\') {
path = path.substring(1);
}
}
return path;
}
/**
* Returns the name of the main BNG file in 'BNGName'.
Expand Down

0 comments on commit d896f3d

Please sign in to comment.