#if defined(__WXPM__)
#define INCL_DOS
#include <os2.h>
- #define LINKAGEMODE _Optlink
-#else
- #define LINKAGEMODE
#endif
#include <stdlib.h>
}
else { // a key
const wxChar *pEnd = pStart;
- while ( *pEnd != wxT('=') && !wxIsspace(*pEnd) ) {
+ while ( *pEnd && *pEnd != wxT('=') && !wxIsspace(*pEnd) ) {
if ( *pEnd == wxT('\\') ) {
// next character may be space or not - still take it because it's
- // quoted
+ // quoted (unless there is nothing)
pEnd++;
+ if ( !*pEnd ) {
+ // the error message will be given below anyhow
+ break;
+ }
}
pEnd++;
bool wxFileConfig::Flush(bool /* bCurrentOnly */)
{
- if ( LineListIsEmpty() || !m_pRootGroup->IsDirty() )
+ if ( LineListIsEmpty() || !m_pRootGroup->IsDirty() || !m_strLocalFile )
return TRUE;
wxTempFile file(m_strLocalFile);