Fix handling multiple leading backslashes in wxFileName under MSW

Extend the existing workaround to work not only with explicitly
wxPATH_DOS paths, but with paths implicitly using the DOS format due to
it being the default format for the current platform.

Closes #19261.
This commit is contained in:
Vadim Zeitlin
2021-09-13 20:53:27 +01:00
parent efb40daf4f
commit 8db2f45171
2 changed files with 9 additions and 1 deletions

View File

@@ -550,6 +550,14 @@ TEST_CASE("wxFileName::UNC", "[filename]")
fn.Assign("\\\\share2\\path2\\name.ext", wxPATH_DOS);
CHECK( fn.GetVolume() == "share2" );
CHECK( fn.GetPath(wxPATH_NO_SEPARATOR, wxPATH_DOS) == "\\path2" );
#ifdef __WINDOWS__
// Check that doubled backslashes in the beginning of the path are not
// misinterpreted as UNC volume when we have a drive letter in the
// beginning.
fn.Assign("d:\\\\root\\directory\\file");
CHECK( fn.GetFullPath() == "d:\\root\\directory\\file" );
#endif // __WINDOWS__
}
TEST_CASE("wxFileName::VolumeUniqueName", "[filename]")