]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
Moved allocation of m_imData or key down gives seg fault
[wxWidgets.git] / src / common / filefn.cpp
index e3be7dfb7b4b430e7b1d24a915c9f32c3debe514..18620e0a5cbcb8c89561663b51141b0afd55d498 100644 (file)
@@ -183,14 +183,14 @@ void wxPathList::AddEnvList (const wxString& envVariable)
         path such as "C:\Program Files" would be split into 2 paths:
         "C:\Program" and "Files"
         */
-//        wxT(" ;"); // Don't seperate with colon in DOS (used for drive)
-        wxT(";"); // Don't seperate with colon in DOS (used for drive)
+//        wxT(" ;"); // Don't separate with colon in DOS (used for drive)
+        wxT(";"); // Don't separate with colon in DOS (used for drive)
 #else
         wxT(" :;");
 #endif
 
-    wxChar *val = wxGetenv (WXSTRINGCAST envVariable);
-    if (val && *val)
+    wxString val ;    
+    if (wxGetEnv (WXSTRINGCAST envVariable, &val))
     {
         wxChar *s = MYcopystring (val);
         wxChar *save_ptr, *token = wxStrtok (s, PATH_TOKS, &save_ptr);
@@ -1011,7 +1011,7 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
         return false;
     }
 #elif defined(__OS2__)
-    if ( ::DosCopy(file2, file2, overwrite ? DCPY_EXISTING : 0) != 0 )
+    if ( ::DosCopy((PSZ)file1.c_str(), (PSZ)file2.c_str(), overwrite ? DCPY_EXISTING : 0) != 0 )
         return false;
 #elif defined(__PALMOS__)
     // TODO with http://www.palmos.com/dev/support/docs/protein_books/Memory_Databases_Files/
@@ -1236,7 +1236,7 @@ bool wxDirExists(const wxChar *pszPathName)
 
     return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY);
 #elif defined(__OS2__)
-    return (::DosSetCurrentDir(WXSTRINGCAST strPath));
+    return (::DosSetCurrentDir((PSZ)(WXSTRINGCAST strPath)));
 #else // !__WIN32__
 
     wxStructStat st;