]> git.saurik.com Git - wxWidgets.git/commitdiff
wxFileName::Normalize(wxPATH_NORM_ENV_VARS) now works
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Oct 2003 23:22:00 +0000 (23:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Oct 2003 23:22:00 +0000 (23:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/filename.cpp

index 18ab3b5253c46422c237b964241d31f6ebc285ed..aa59ed5a0942ea8bbe6518350f1c5ba73d8623ca 100644 (file)
@@ -65,11 +65,12 @@ All:
 - wxDateTime::ParseDateTime() implemented (Linus McCabe)
 - wxHTTP::GetResponse() added (David Nock)
 - added conversions to/from UTF 16/32 LE/BE (Andreas Pflug)
-- wxFileName::Normalize(wxPATH_NORM_ALL) doesn't lower filename case any more
 - added wxTextInputStream::ReadChar() (M.J.Wetherell)
 - added translation to Afrikaans (Petri Jooste)
 - Spanish translations updated (Javier San Jose)
 - added gettext plural forms support to wxLocale (Michael N. Filippov)
+- wxFileName::Normalize(wxPATH_NORM_ALL) doesn't lower filename case any more
+- wxFileName::Normalize(wxPATH_NORM_ENV_VARS) now works
 
 All (GUI):
 
index 64437fa16147d480c01a3b77b29caf6bcc3d80c3..757bba49a8bf58b855e776256bbd756057945dda 100644 (file)
@@ -848,6 +848,18 @@ bool wxFileName::Normalize(int flags,
                            const wxString& cwd,
                            wxPathFormat format)
 {
+    // deal with env vars renaming first as this may seriously change the path
+    if ( flags & wxPATH_NORM_ENV_VARS )
+    {
+        wxString pathOrig = GetFullPath(format);
+        wxString path = wxExpandEnvVars(pathOrig);
+        if ( path != pathOrig )
+        {
+            Assign(path);
+        }
+    }
+
+
     // the existing path components
     wxArrayString dirs = GetDirs();
 
@@ -940,11 +952,6 @@ bool wxFileName::Normalize(int flags,
             }
         }
 
-        if ( flags & wxPATH_NORM_ENV_VARS )
-        {
-            dir = wxExpandEnvVars(dir);
-        }
-
         if ( (flags & wxPATH_NORM_CASE) && !IsCaseSensitive(format) )
         {
             dir.MakeLower();