#if defined(__WXPM__)
#define INCL_DOS
#include <os2.h>
- #define LINKAGEMODE _Optlink
-#else
- #define LINKAGEMODE
#endif
#include <stdlib.h>
{
wxString strDir;
- #ifdef __UNIX__
+ #ifdef __VMS__ // Note if __VMS is defined __UNIX is also defined
+ strDir = wxT("sys$manager:");
+ #elif defined( __UNIX__ )
strDir = wxT("/etc/");
#elif defined(__WXPM__)
ULONG aulSysInfo[QSV_MAX] = {0};
#ifndef __WXMAC__
wxGetHomeDir(&strDir);
-#ifdef __UNIX__
+#ifndef __VMS__
+# ifdef __UNIX__
if (strDir.Last() != wxT('/')) strDir << wxT('/');
#else
if (strDir.Last() != wxT('\\')) strDir << wxT('\\');
#endif
+#endif
#else
// no local dir concept on mac
return GetGlobalDir() ;
wxString wxFileConfig::GetLocalFileName(const wxChar *szFile)
{
- wxString str = GetLocalDir();
-
+#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( ' ' );
+#else
+ wxString str = GetLocalDir();
+#endif
+
#ifdef __UNIX__
str << wxT('.');
#endif
}
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::GetNextGroup (wxString& str, long& lIndex) const
{
if ( size_t(lIndex) < m_pCurrentGroup->Groups().Count() ) {
- str = m_pCurrentGroup->Groups()[lIndex++]->Name();
+ str = m_pCurrentGroup->Groups()[(size_t)lIndex++]->Name();
return TRUE;
}
else
bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
{
if ( size_t(lIndex) < m_pCurrentGroup->Entries().Count() ) {
- str = m_pCurrentGroup->Entries()[lIndex++]->Name();
+ str = m_pCurrentGroup->Entries()[(size_t)lIndex++]->Name();
return TRUE;
}
else
bool wxFileConfig::Flush(bool /* bCurrentOnly */)
{
- if ( LineListIsEmpty() || !m_pRootGroup->IsDirty() )
+ if ( LineListIsEmpty() || !m_pRootGroup->IsDirty() || !m_strLocalFile )
return TRUE;
wxTempFile file(m_strLocalFile);