Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMarkus Schorn2006-11-06 13:16:26 +0000
committerMarkus Schorn2006-11-06 13:16:26 +0000
commitd5e1e3f2ea4f80367fe6a85b646045eedd158b8f (patch)
tree01114967ff21e3a6a18f194b8769222e0de64fd4 /build
parent02e693474e775f9bed8c3f34a4c823daef5d1ea6 (diff)
downloadorg.eclipse.cdt-d5e1e3f2ea4f80367fe6a85b646045eedd158b8f.tar.gz
org.eclipse.cdt-d5e1e3f2ea4f80367fe6a85b646045eedd158b8f.tar.xz
org.eclipse.cdt-d5e1e3f2ea4f80367fe6a85b646045eedd158b8f.zip
Fix handling of cygdrive in scanner discovery
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java29
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java5
2 files changed, 18 insertions, 16 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java
index 9ac6474f222..cb1560137f9 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java
@@ -93,26 +93,25 @@ public abstract class AbstractGCCBOPConsoleParserUtility {
pwd = dir.removeFirstSegments(fBaseDirectory.segmentCount());
} else {
// check if it is a cygpath
- if (dir.toString().startsWith("/cygdrive/")) { //$NON-NLS-1$
- char driveLetter = dir.toString().charAt(10);
- driveLetter = (Character.isLowerCase(driveLetter)) ? Character.toUpperCase(driveLetter) : driveLetter;
- StringBuffer buf = new StringBuffer();
- buf.append(driveLetter);
- buf.append(':');
- String drive = buf.toString();
- pwd = dir.removeFirstSegments(2);
- pwd = pwd.setDevice(drive);
- pwd = pwd.makeAbsolute();
- }
- else {
- pwd = dir;
- }
+ pwd= convertCygpath(dir);
}
fDirectoryStack.addElement(pwd);
}
}
- protected IPath popDirectory() {
+ protected IPath convertCygpath(IPath path) {
+ if (path.segmentCount() > 1 && path.segment(0).equals("cygdrive")) { //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer(2);
+ buf.append(Character.toUpperCase(path.segment(1).charAt(0)));
+ buf.append(':');
+ path = path.removeFirstSegments(2);
+ path = path.setDevice(buf.toString());
+ path = path.makeAbsolute();
+ }
+ return path;
+ }
+
+ protected IPath popDirectory() {
int i = getDirectoryLevel();
if (i != 0) {
IPath dir = (IPath) fDirectoryStack.lastElement();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java
index ecc7ed26099..e8f7072b4e3 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParserUtility.java
@@ -175,7 +175,10 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
*/
IPath getAbsolutePath(String filePath) {
IPath pFilePath;
- if (filePath.startsWith("/") || filePath.startsWith("\\") || //$NON-NLS-1$ //$NON-NLS-2$
+ if (filePath.startsWith("/")) { //$NON-NLS-1$
+ return 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) == '/'))) {

Back to the top