Don't consider extra ".." an error in wxFileName::Normalize().
The path being normalized could have come from user and there doesn't seem to be any point in complaining about too many ".."s in it when we can handle them correctly instead. So simply ignore the extra ".."s for the absolute paths and keep them unchanged for the relative ones instead of returning an error. See #10960. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -322,8 +322,11 @@ void FileNameTestCase::TestNormalize()
|
||||
|
||||
// test wxPATH_NORM_DOTS
|
||||
{ "a/.././b/c/../../", wxPATH_NORM_DOTS, "", wxPATH_UNIX },
|
||||
{ "./", wxPATH_NORM_DOTS, "", wxPATH_UNIX },
|
||||
{ "b/../", wxPATH_NORM_DOTS, "", wxPATH_UNIX },
|
||||
{ "", wxPATH_NORM_DOTS, "", wxPATH_UNIX },
|
||||
{ "./foo", wxPATH_NORM_DOTS, "foo", wxPATH_UNIX },
|
||||
{ "b/../bar", wxPATH_NORM_DOTS, "bar", wxPATH_UNIX },
|
||||
{ "c/../../quux", wxPATH_NORM_DOTS, "../quux", wxPATH_UNIX },
|
||||
{ "/c/../../quux", wxPATH_NORM_DOTS, "/quux", wxPATH_UNIX },
|
||||
|
||||
// test wxPATH_NORM_TILDE: notice that ~ is only interpreted specially
|
||||
// when it is the first character in the file name
|
||||
|
Reference in New Issue
Block a user