]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/regconf.cpp
Mutiple updates from SciTech for wxWindows including the following:
[wxWidgets.git] / src / msw / regconf.cpp
index 2fa8685006225b6723877d306ed7262b07f78751..07fcf8201b4224871c55944a7404c7880c487d19 100644 (file)
@@ -274,6 +274,7 @@ void wxRegConfig::SetPath(const wxString& strPath)
                             // check the boundary condition below
 
                             // this is more efficient than strrchr()
                             // check the boundary condition below
 
                             // this is more efficient than strrchr()
+                            dst--;
                             while ( *dst != wxCONFIG_PATH_SEPARATOR )
                             {
                                 dst--;
                             while ( *dst != wxCONFIG_PATH_SEPARATOR )
                             {
                                 dst--;
@@ -288,10 +289,13 @@ void wxRegConfig::SetPath(const wxString& strPath)
                             posLastSlash = -1;
                         }
 
                             posLastSlash = -1;
                         }
 
-                        // this shouldn't happen
+                        // we must have found a slash one way or another!
                         wxASSERT_MSG( *dst == wxCONFIG_PATH_SEPARATOR,
                                       _T("error in wxRegConfig::SetPath") );
 
                         wxASSERT_MSG( *dst == wxCONFIG_PATH_SEPARATOR,
                                       _T("error in wxRegConfig::SetPath") );
 
+                        // stay at the same position
+                        dst--;
+
                         // we killed one
                         totalSlashes--;
                     }
                         // we killed one
                         totalSlashes--;
                     }