]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
use wxColourDatabase::Find() instead of deprecated FindColour(); some minor code...
[wxWidgets.git] / src / common / filename.cpp
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();