Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318738

Summary: Incorrect chopping of weird paths in option value like ${workspace_loc:/proj}/path
Product: [Tools] CDT Reporter: James Blackburn <jamesblackburn+eclipse>
Component: cdt-build-managedAssignee: James Blackburn <jamesblackburn+eclipse>
Status: RESOLVED FIXED QA Contact: Chris Recoskie <recoskie>
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: 7.0.1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix 1 jamesblackburn+eclipse: iplog-

Description James Blackburn CLA 2010-07-02 10:43:34 EDT
Created attachment 173309 [details]
fix 1

The paths contributed back from MBS are badly chopped if they're strangely constructed by the user. The result is failure (/loss) at some arbitrary point in the future.

1) Create HelloWorld Proejct
2) Project Properties > C/C++ Build / Settings > Includes
3) Add > Workspace > select: helloworld > Ok > Ok
4) Add > Workspace > select: helloworld/src > Ok > Ok
5) Change "${workspace_loc:/${ProjName}/src}" to 
"${workspace_loc:/${ProjName}}/src"

Look in C/C++ General > Paths and Symbols, only ${ProjName} has been exported by the MBS. In fact, due to string chopping, the two paths have collided.

Trivial patch attached.  In the future we should look again at why we transform paths in this way before passing them to cdt.core rather than let all this translation happen magically in ICSettingEntry.
Comment 1 James Blackburn CLA 2010-07-02 10:47:32 EDT
Committed to 7.0.1 + HEAD