From fcf56ee4dec6b75312833a4fc0195518379234b6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 24 Nov 2010 12:43:45 +0000 Subject: [PATCH] Warn that normalizing a valid path may make it invalid sometimes. Mention the special case of a path without file name and with directory that normalizes to empty string. See #10960. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/filename.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/interface/wx/filename.h b/interface/wx/filename.h index cadedb661b..c491cc4cb9 100644 --- a/interface/wx/filename.h +++ b/interface/wx/filename.h @@ -962,9 +962,16 @@ public: int flags = 0); /** - Normalize the path. With the default flags value, the path will be - made absolute, without any ".." and "." and all environment - variables will be expanded in it. + Normalize the path. + + With the default flags value, the path will be made absolute, without + any ".." and "." and all environment variables will be expanded in it. + + Notice that in some rare cases normalizing a valid path may result in + an invalid wxFileName object. E.g. normalizing "./" path using + wxPATH_NORM_DOTS but not wxPATH_NORM_ABSOLUTE will result in a + completely empty and thus invalid object. As long as there is a non + empty file name the result of normalization will be valid however. @param flags The kind of normalization to do with the file name. It can be -- 2.45.2