Applied patch [ 1381016 ] wxFileName should use TMPDIR
Paul Cornett git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4ee8e5cde3
commit
6091caf088
@ -604,6 +604,19 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
|
|||||||
// use the directory specified by the prefix
|
// use the directory specified by the prefix
|
||||||
SplitPath(prefix, &dir, &name, NULL /* extension */);
|
SplitPath(prefix, &dir, &name, NULL /* extension */);
|
||||||
|
|
||||||
|
if (dir.empty())
|
||||||
|
{
|
||||||
|
dir = wxGetenv(_T("TMPDIR"));
|
||||||
|
if (dir.empty())
|
||||||
|
{
|
||||||
|
dir = wxGetenv(_T("TMP"));
|
||||||
|
if (dir.empty())
|
||||||
|
{
|
||||||
|
dir = wxGetenv(_T("TEMP"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(__WXWINCE__)
|
#if defined(__WXWINCE__)
|
||||||
if (dir.empty())
|
if (dir.empty())
|
||||||
{
|
{
|
||||||
@ -651,27 +664,14 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
|
|||||||
#else // !Windows
|
#else // !Windows
|
||||||
if ( dir.empty() )
|
if ( dir.empty() )
|
||||||
{
|
{
|
||||||
#if defined(__WXMAC__) && !defined(__DARWIN__)
|
// default
|
||||||
dir = wxMacFindFolder( (short) kOnSystemDisk, kTemporaryFolderType, kCreateFolder ) ;
|
#if defined(__DOS__) || defined(__OS2__)
|
||||||
#else // !Mac
|
dir = _T(".");
|
||||||
dir = wxGetenv(_T("TMP"));
|
#elif defined(__WXMAC__)
|
||||||
if ( dir.empty() )
|
dir = wxMacFindFolder(short(kOnSystemDisk), kTemporaryFolderType, kCreateFolder);
|
||||||
{
|
#else
|
||||||
dir = wxGetenv(_T("TEMP"));
|
dir = _T("/tmp");
|
||||||
}
|
#endif
|
||||||
|
|
||||||
if ( dir.empty() )
|
|
||||||
{
|
|
||||||
// default
|
|
||||||
#if defined(__DOS__) || defined(__OS2__)
|
|
||||||
dir = _T(".");
|
|
||||||
#elif defined(__WXMAC__)
|
|
||||||
dir = wxMacFindFolder( (short) kOnSystemDisk, kTemporaryFolderType, kCreateFolder ) ;
|
|
||||||
#else
|
|
||||||
dir = _T("/tmp");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif // Mac/!Mac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
path = dir;
|
path = dir;
|
||||||
@ -752,9 +752,6 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
|
|||||||
path = pathTry;
|
path = pathTry;
|
||||||
#endif // HAVE_MKTEMP/!HAVE_MKTEMP
|
#endif // HAVE_MKTEMP/!HAVE_MKTEMP
|
||||||
|
|
||||||
if ( !path.empty() )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
|
#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
|
||||||
|
|
||||||
#endif // Windows/!Windows
|
#endif // Windows/!Windows
|
||||||
|
Loading…
Reference in New Issue
Block a user