mirror of https://github.com/acidanthera/audk.git
1. Fix EDKT330 Source files in sub-directories are not added to MSA correctly
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1752 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5776c5c045
commit
0915a2ce53
|
@ -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());
|
||||
}
|
||||
//
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue