X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f57fe24c6389876d7ddf02aa7a09f3b48a6956de..e107d0536ca8d441a54420a07fbee8e02c532269:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 873515cc50..92ca337641 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -111,11 +111,14 @@ wxString wxFileConfig::GetGlobalDir() wxString wxFileConfig::GetLocalDir() { wxString strDir; - + wxGetHomeDir(&strDir); - if (strDir.Last() != '/' && strDir.Last() != '\\') - strDir += "/"; +#ifdef __UNIX__ + if (strDir.Last() != '/') strDir << '/'; +#else + if (strDir.Last() != '\\') strDir << '\\'; +#endif return strDir; } @@ -623,9 +626,9 @@ bool wxFileConfig::Write(const wxString& key, const wxString& szValue) bool wxFileConfig::Write(const wxString& key, long lValue) { // ltoa() is not ANSI :-( - char szBuf[40]; // should be good for sizeof(long) <= 16 (128 bits) - sprintf(szBuf, "%ld", lValue); - return Write(key, szBuf); + wxString buf; + buf.Printf("%ld", lValue); + return Write(key, buf); } bool wxFileConfig::Flush(bool /* bCurrentOnly */) @@ -759,7 +762,7 @@ void wxFileConfig::LineListRemove(LineList *pLine) // last entry? if ( pNext == NULL ) m_linesTail = pPrev; - else + else pNext->SetPrev(pPrev); delete pLine; @@ -1325,7 +1328,7 @@ wxString FilterOut(const wxString& str) { if(str.IsEmpty()) return str; - + wxString strResult; strResult.Alloc(str.Len());