From e4cac036c21c744f00d048b0b814caaf0088a565 Mon Sep 17 00:00:00 2001 From: Mikhail Sennikovsky Date: Fri, 11 May 2007 12:15:42 +0000 Subject: [PATCH] Fix for [Bug 171976] Internal builder does not handle linked folders --- .../buildmodel/BuildDescriptionManager.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java index 07a5407fb66..36c876943d9 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java @@ -286,19 +286,23 @@ public class BuildDescriptionManager { if(!location.isAbsolute()) return location; - IPath path = null; +// IPath path = null; IPath tmp = cwd; + StringBuffer buf = null; while(tmp.segmentCount() != 0){ if(tmp.isPrefixOf(location)){ IPath p = location.removeFirstSegments(tmp.segmentCount()).setDevice(null); - if(path == null) + if(buf == null) return p; - return path.append(p); + buf.append(p.makeRelative().toString()); + return new Path(buf.toString()); + } + if(buf == null){ + buf = new StringBuffer(); + buf.append("../"); //$NON-NLS-1$ + } else { + buf.append("../"); //$NON-NLS-1$ } - if(path == null) - path = new Path(".."); //$NON-NLS-1$ - else - path.append(".."); //$NON-NLS-1$ tmp = tmp.removeLastSegments(1); }