mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 345750: tidy up cosmetics
This commit is contained in:
parent
950f133f77
commit
d5d717128b
1 changed files with 7 additions and 13 deletions
|
@ -224,26 +224,16 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
|||
* @return filePath : IPath - not <code>null</code>
|
||||
*/
|
||||
public IPath getAbsolutePath(String filePath) {
|
||||
IPath p = getAbsolutePath2(filePath);
|
||||
if (p.getDevice()==null) {
|
||||
p = p.setDevice(getWorkingDirectory().getDevice());
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
private IPath getAbsolutePath2(String filePath) {
|
||||
IPath pFilePath;
|
||||
if (filePath.startsWith("/")) { //$NON-NLS-1$
|
||||
return convertCygpath(new Path(filePath));
|
||||
}
|
||||
else if (filePath.startsWith("\\") || //$NON-NLS-1$
|
||||
pFilePath = convertCygpath(new Path(filePath));
|
||||
} else if (filePath.startsWith("\\") || //$NON-NLS-1$
|
||||
(!filePath.startsWith(".") && //$NON-NLS-1$
|
||||
filePath.length() > 2 && filePath.charAt(1) == ':' &&
|
||||
(filePath.charAt(2) == '\\' || filePath.charAt(2) == '/'))) {
|
||||
// absolute path
|
||||
pFilePath = new Path(filePath);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// relative path
|
||||
IPath cwd = getWorkingDirectory();
|
||||
if (!cwd.isAbsolute()) {
|
||||
|
@ -259,6 +249,10 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
|||
}
|
||||
pFilePath = cwd.append(filePath);
|
||||
}
|
||||
|
||||
if (pFilePath.getDevice()==null) {
|
||||
pFilePath = pFilePath.setDevice(getWorkingDirectory().getDevice());
|
||||
}
|
||||
return pFilePath;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue