diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 9250d85d90..9f9846f969 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -189,8 +189,8 @@ void wxPathList::AddEnvList (const wxString& envVariable) 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);