Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318738 - Incorrect chopping of weird paths in option value like ${workspace_loc:/proj}/path
Summary: Incorrect chopping of weird paths in option value like ${workspace_loc:/proj}...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 7.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 7.0.1   Edit
Assignee: James Blackburn CLA
QA Contact: Chris Recoskie CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 10:43 EDT by James Blackburn CLA
Modified: 2010-07-02 11:23 EDT (History)
0 users

See Also:


Attachments
fix 1 (1.45 KB, patch)
2010-07-02 10:43 EDT, James Blackburn CLA
jamesblackburn+eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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