mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
relative path calculation fixes on Linix
This commit is contained in:
parent
b7eb6a93b0
commit
786867b4be
2 changed files with 7 additions and 2 deletions
|
@ -237,7 +237,7 @@ public class ManagedBuildCoreTests20 extends TestCase {
|
|||
// This first path is a built-in, so it will not be manipulated by build manager
|
||||
expectedPaths[0] = (new Path("/usr/include")).toOSString();
|
||||
expectedPaths[1] = (new Path("/opt/gnome/include")).toOSString();
|
||||
IPath path = new Path("C:/home/tester/include");
|
||||
IPath path = new Path("C:\\home\\tester/include");
|
||||
if(path.isAbsolute()) // for win32 path is treated as absolute
|
||||
expectedPaths[2] = path.toOSString();
|
||||
else // for Linux path is relative
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.dataprovider;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||
import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
|
||||
|
@ -22,6 +24,9 @@ class PathInfo {
|
|||
private String fAbsoluteInfoStr;
|
||||
private Boolean fIsAbsolute;
|
||||
private SupplierBasedCdtVariableSubstitutor fSubstitutor;
|
||||
|
||||
private static final boolean IS_WINDOWS = File.separatorChar == '\\';
|
||||
|
||||
|
||||
public PathInfo(String str, boolean isWspPath, SupplierBasedCdtVariableSubstitutor subst){
|
||||
fUnresolvedStr = str;
|
||||
|
@ -74,7 +79,7 @@ class PathInfo {
|
|||
return false;
|
||||
|
||||
char c1 = str.charAt(1);
|
||||
if(c1 == ':')
|
||||
if(IS_WINDOWS && c1 == ':')
|
||||
return true;
|
||||
|
||||
if(length < 4)
|
||||
|
|
Loading…
Add table
Reference in a new issue