X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..0f05afccede840e04872bfc82103b689b8edc447:/src/common/fileconf.cpp?ds=sidebyside diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index a6916f0995..0d5b0a4ae3 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -230,13 +230,14 @@ wxString wxFileConfig::GetLocalDir() #ifndef __WXMAC__ wxGetHomeDir(&strDir); -#ifndef __VMS__ -# ifdef __UNIX__ - if (strDir.Last() != wxT('/')) strDir << wxT('/'); +#ifdef __UNIX__ +#ifdef __VMS + if (strDir.Last() != wxT(']')) +#endif + if (strDir.Last() != wxT('/')) strDir << wxT('/'); #else if (strDir.Last() != wxT('\\')) strDir << wxT('\\'); #endif -#endif #else // no local dir concept on mac return GetGlobalDir() ; @@ -267,12 +268,12 @@ wxString wxFileConfig::GetLocalFileName(const wxChar *szFile) #ifdef __VMS__ // On VMS I saw the problem that the home directory was appended // twice for the configuration file. Does that also happen for other // platforms? - wxString str = wxT( ' ' ); + wxString str = wxT( '.' ); #else wxString str = GetLocalDir(); #endif - #ifdef __UNIX__ + #if defined( __UNIX__ ) && !defined( __VMS ) str << wxT('.'); #endif @@ -431,8 +432,15 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal) pEnd = pStart; while ( *++pEnd != wxT(']') ) { - if ( *pEnd == wxT('\n') || *pEnd == wxT('\0') ) + if ( *pEnd == wxT('\\') ) { + // the next char is escaped, so skip it even if it is ']' + pEnd++; + } + + if ( *pEnd == wxT('\n') || *pEnd == wxT('\0') ) { + // we reached the end of line, break out of the loop break; + } } if ( *pEnd != wxT(']') ) {