| Summary: | PathUtil doesn't make paths relative correctly across volumes | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | John Arthorne <john.arthorne> | ||||
| Component: | p2 | Assignee: | John Arthorne <john.arthorne> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | dj.houghton, jcayne, paulslau, tjwatson | ||||
| Version: | 3.6 | ||||||
| Target Milestone: | 3.6.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 171764 [details]
Fix and regression test v01
I noticed while testing this that PathUtil has all kinds of crazy behaviour. It can return a mixture of / and \ path separators on Windows. It also creates bad relative URLs such as file:a/b/ (relative URL shouldn't have a device). In any case I've opted not to change anything else in this patch except the cross-volume bug. This class is generally only used in backwards compatibility situations like reading/writing plaform.xml, and most of p2 uses the much more consistent URIUtil methods. Sorry, that first line should read:
PathUtil.makeRelative("file:/c:/a/b", new URL("file:/d:/a/x))
Returns: "file:../b" but should return "file:/c:/a/b".
Fix released for 3.6.1 and 3.7 *** Bug 311387 has been marked as a duplicate of this bug. *** |
Build: 3.6 PathUtil.makeRelative("file:/a/b", new URL("file:/d:/a/x)) Returns: "file:../b", but since the device is different it should return "file:/c:/a/b".