Fix wxFileName::MakeRelativeTo() for directory relatively to itself.

The expected result in this case is ".", but the filename became empty instead
when wxPATH_NATIVE was used.

Fix this by examining GetFormat(format), which takes care of mapping
wxPATH_NATIVE to its real value, instead of wxPATH_NATIVE itself.

Also add a unit test verifying that this works as expected.

Closes #17010.
This commit is contained in:
Vadim Zeitlin
2015-05-29 16:23:17 +02:00
parent a029ac7690
commit de891ddb03
3 changed files with 41 additions and 8 deletions

View File

@@ -577,6 +577,10 @@ Major new features in this release
3.0.3: (released 2015-??-??)
----------------------------
All:
- Fix wxFileName::MakeRelativeTo() for directory relatively to itself.
Unix:
- Fix wxIPaddress::Hostname() failing if /etc/hosts contained very long names.