summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java4
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java7
2 files changed, 8 insertions, 3 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
index 33dc521eda..b29bfe8a7e 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
@@ -230,10 +230,10 @@ public class Tools {
//
// remove file separator of rear
//
- if (path.indexOf(DataType.DOS_FILE_SEPARATOR) == path.length() - DataType.DOS_FILE_SEPARATOR.length()) {
+ if (path.length() > 0 && path.indexOf(DataType.DOS_FILE_SEPARATOR) == path.length() - DataType.DOS_FILE_SEPARATOR.length()) {
path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
}
- if (path.indexOf(DataType.UNIX_FILE_SEPARATOR) == path.length() - DataType.UNIX_FILE_SEPARATOR.length()) {
+ if (path.length() > 0 && path.indexOf(DataType.UNIX_FILE_SEPARATOR) == path.length() - DataType.UNIX_FILE_SEPARATOR.length()) {
path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
}
//
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
index 6ca65fa04e..d7df17eeb6 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
@@ -526,7 +526,12 @@ public class SourceFilesDlg extends IDialog {
File f[] = fc.getSelectedFiles();
String s = "";
for (int index = 0; index < f.length; index++) {
- s = s + f[index].getName() + ";";
+ String relativePath = "";
+ relativePath = Tools.getRelativePath(Tools.getFilePathOnly(f[index].getPath()), Tools.getFilePathOnly(msaFileName));
+ if (!Tools.isEmpty(relativePath)) {
+ relativePath = relativePath + DataType.UNIX_FILE_SEPARATOR;
+ }
+ s = s + relativePath + f[index].getName() + ";";
}
this.jTextFieldFileName.setText(s);
}