mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 07:35:24 +02:00
Bug 158538 - fixed filetype parsing for mac os and other unix systems that support blanks in file names and someimes don't return colon delimited types from the file command.
This commit is contained in:
parent
675ec536ee
commit
1069f7dc3d
1 changed files with 9 additions and 8 deletions
|
@ -151,7 +151,7 @@ public class SystemFileClassifier {
|
|||
String args[] = new String[3];
|
||||
args[0] = "sh";
|
||||
args[1] = "-c";
|
||||
args[2] = "file " + absolutePath;
|
||||
args[2] = "file \"" + absolutePath + "\"";
|
||||
|
||||
BufferedReader poutReader = null;
|
||||
|
||||
|
@ -205,14 +205,15 @@ public class SystemFileClassifier {
|
|||
// default type
|
||||
String type = "file";
|
||||
|
||||
// look for colon
|
||||
String name = line;
|
||||
String fulltype = "";
|
||||
|
||||
// Look for colon. Name appears before colon. Full type appears after the colon
|
||||
int colon = line.indexOf(':');
|
||||
|
||||
// name appears before colon
|
||||
String name = line.substring(0, colon);
|
||||
|
||||
// the full type appears after the colon
|
||||
String fulltype = line.substring(colon + 1, line.length()).trim();
|
||||
if (colon >= 0) {
|
||||
name = line.substring(0, colon);
|
||||
fulltype = line.substring(colon + 1, line.length()).trim();
|
||||
}
|
||||
|
||||
// if it is a *.class file, then we look for main method and qulaified class name
|
||||
// as part of the classification
|
||||
|
|
Loading…
Add table
Reference in a new issue