]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed handling of root paths: now checks if string ends with / before appending ...
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 10 May 2001 16:41:34 +0000 (16:41 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 10 May 2001 16:41:34 +0000 (16:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/config.cpp
src/msw/regconf.cpp

index feccd99ab00c66508a97aac4ce8a70e376d6098a..be417c42432ca4d1b22db32f62627db51e1b5997 100644 (file)
@@ -246,7 +246,9 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
     m_bChanged = TRUE;
     m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR);
     m_strOldPath = m_pContainer->GetPath();
-    m_strOldPath += wxCONFIG_PATH_SEPARATOR;
+    if ( m_strOldPath.Len() == 0 || 
+         m_strOldPath.Last() != wxCONFIG_PATH_SEPARATOR )
+        m_strOldPath += wxCONFIG_PATH_SEPARATOR;
     m_pContainer->SetPath(strPath);
   }
   else {
index 4b9844cfbf6c361a8862e92da2e8b4b28a389d9a..fefb7b86c9cc6823cc4227a55d8c0fef085d78f5 100644 (file)
@@ -221,7 +221,11 @@ void wxRegConfig::SetPath(const wxString& strPath)
         {
             strFullPath.reserve(2*m_strPath.length());
 
-            strFullPath << m_strPath << wxCONFIG_PATH_SEPARATOR << strPath;
+            strFullPath << m_strPath;
+            if ( strFullPath.Len() == 0 || 
+                 strFullPath.Last() != wxCONFIG_PATH_SEPARATOR )
+                strFullPath << wxCONFIG_PATH_SEPARATOR; 
+            strFullPath << strPath;
         }
 
         // simplify it: we need to handle ".." here