]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fileconf.cpp
support mac on little endian systems
[wxWidgets.git] / src / common / fileconf.cpp
index 639e9b089e8e483d6de1721d9c7d242e50582b30..2944b099951415d6c73e5ab3d4f6dee9def07dfd 100644 (file)
@@ -495,7 +495,7 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, wxMBConv& conv)
         char buf[1024];
         do
         {
-            inStream.Read(buf, WXSIZEOF(buf));
+            inStream.Read(buf, WXSIZEOF(buf)-1);  // leave room for the NULL
 
             const wxStreamError err = inStream.GetLastError();
 
@@ -1098,12 +1098,13 @@ bool wxFileConfig::DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso)
   if ( !m_pCurrentGroup->DeleteEntry(path.Name()) )
     return false;
 
+  SetDirty();
+
   if ( bGroupIfEmptyAlso && m_pCurrentGroup->IsEmpty() ) {
     if ( m_pCurrentGroup != m_pRootGroup ) {
       wxFileConfigGroup *pGroup = m_pCurrentGroup;
       SetPath(wxT(".."));  // changes m_pCurrentGroup!
-      if ( m_pCurrentGroup->DeleteSubgroupByName(pGroup->Name()) )
-          SetDirty();
+      m_pCurrentGroup->DeleteSubgroupByName(pGroup->Name());
     }
     //else: never delete the root group
   }