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>
|
* @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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue