]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
Disable accidently committed F-Script code.
[wxWidgets.git] / src / unix / utilsunx.cpp
index dffddb191ade62915cae4d77f104f6987e65054d..1cdeb6e6706eb1a70c6d883fa43572fefec46117 100644 (file)
@@ -695,7 +695,7 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process)
 
 const wxChar* wxGetHomeDir( wxString *home  )
 {
-    *home = wxGetUserHome( wxEmptyString );
+    *home = wxGetUserHome();
     wxString tmp;
     if ( home->empty() )
         *home = wxT("/");
@@ -707,11 +707,7 @@ const wxChar* wxGetHomeDir( wxString *home  )
     return home->c_str();
 }
 
-#if wxUSE_UNICODE
-const wxMB2WXbuf wxGetUserHome( const wxString &user )
-#else // just for binary compatibility -- there is no 'const' here
-char *wxGetUserHome( const wxString &user )
-#endif
+wxString wxGetUserHome( const wxString &user )
 {
     struct passwd *who = (struct passwd *) NULL;
 
@@ -721,20 +717,17 @@ char *wxGetUserHome( const wxString &user )
 
         if ((ptr = wxGetenv(wxT("HOME"))) != NULL)
         {
-#if wxUSE_UNICODE
-            wxWCharBuffer buffer( ptr );
-            return buffer;
-#else
             return ptr;
-#endif
         }
-        if ((ptr = wxGetenv(wxT("USER"))) != NULL || (ptr = wxGetenv(wxT("LOGNAME"))) != NULL)
+
+        if ((ptr = wxGetenv(wxT("USER"))) != NULL ||
+             (ptr = wxGetenv(wxT("LOGNAME"))) != NULL)
         {
             who = getpwnam(wxSafeConvertWX2MB(ptr));
         }
 
-        // We now make sure the the user exists!
-        if (who == NULL)
+        // make sure the user exists!
+        if ( !who )
         {
             who = getpwuid(getuid());
         }
@@ -1101,7 +1094,10 @@ static bool wxDoSetEnv(const wxString& variable, const char *value)
     if ( !value )
     {
 #ifdef HAVE_UNSETENV
-        return unsetenv(variable.mb_str()) == 0;
+        // don't test unsetenv() return value: it's void on some systems (at
+        // least Darwin)
+        unsetenv(variable.mb_str());
+        return true;
 #else
         value = ""; // we can't pass NULL to setenv()
 #endif