mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Bug 318738 - Incorrect chopping of weird paths in option value like ${workspace_loc:/proj}/path
This commit is contained in:
parent
d5ea7d1248
commit
2a0ae90a25
1 changed files with 12 additions and 1 deletions
|
@ -3888,10 +3888,17 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
return fullPath;
|
return fullPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representing the workspace relative path with ${workspace_loc: stripped
|
||||||
|
* or null if the String path doesn't contain workspace_log
|
||||||
|
* @param path String path to have workspace_loc removed
|
||||||
|
* @return workspace path or null
|
||||||
|
*/
|
||||||
public static String locationToFullPath(String path){
|
public static String locationToFullPath(String path){
|
||||||
|
path = path.trim();
|
||||||
if(!path.startsWith("${")) //$NON-NLS-1$
|
if(!path.startsWith("${")) //$NON-NLS-1$
|
||||||
return null;
|
return null;
|
||||||
int index = path.lastIndexOf('}');
|
final int index = path.lastIndexOf('}');
|
||||||
if(index == -1)
|
if(index == -1)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -3907,6 +3914,10 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
} else {
|
} else {
|
||||||
result = "/"; //$NON-NLS-1$
|
result = "/"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
// If the user has a path like ${workspace_loc:/thing}/other/thing
|
||||||
|
// ensure we return /thing/other/thing
|
||||||
|
if (index < path.length() - 1)
|
||||||
|
result += path.substring(index + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue