1
0
Fork 0
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:
Andrew Gvozdev 2011-08-18 12:14:13 -04:00
parent 950f133f77
commit d5d717128b

View file

@ -224,26 +224,16 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
* @return filePath : IPath - not <code>null</code> * @return filePath : IPath - not <code>null</code>
*/ */
public IPath getAbsolutePath(String filePath) { 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; IPath pFilePath;
if (filePath.startsWith("/")) { //$NON-NLS-1$ if (filePath.startsWith("/")) { //$NON-NLS-1$
return convertCygpath(new Path(filePath)); pFilePath = convertCygpath(new Path(filePath));
} } else if (filePath.startsWith("\\") || //$NON-NLS-1$
else if (filePath.startsWith("\\") || //$NON-NLS-1$
(!filePath.startsWith(".") && //$NON-NLS-1$ (!filePath.startsWith(".") && //$NON-NLS-1$
filePath.length() > 2 && filePath.charAt(1) == ':' && filePath.length() > 2 && filePath.charAt(1) == ':' &&
(filePath.charAt(2) == '\\' || filePath.charAt(2) == '/'))) { (filePath.charAt(2) == '\\' || filePath.charAt(2) == '/'))) {
// absolute path // absolute path
pFilePath = new Path(filePath); pFilePath = new Path(filePath);
} } else {
else {
// relative path // relative path
IPath cwd = getWorkingDirectory(); IPath cwd = getWorkingDirectory();
if (!cwd.isAbsolute()) { if (!cwd.isAbsolute()) {
@ -259,6 +249,10 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
} }
pFilePath = cwd.append(filePath); pFilePath = cwd.append(filePath);
} }
if (pFilePath.getDevice()==null) {
pFilePath = pFilePath.setDevice(getWorkingDirectory().getDevice());
}
return pFilePath; return pFilePath;
} }