From: mohr@elektron.ikp.physik.tu-darmstadt.de (Andreas Mohr)
Newsgroups: local.list.wine.patches
Subject: profile fix
Date: 19 Nov 1999 11:47:40 +0100
Organization: home
Lines: 67
Message-ID: <199911190815.JAA16531@hertz.ikp.physik.tu-darmstadt.de>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary=ELM942999323-16505-0_
Content-Transfer-Encoding: 7bit
X-Resent-Date: Fri, 19 Nov 1999 01:15:36 -0700
X-To: wine-patches@winehq.com
X-Mailer: ELM [version 2.4ME+ PL47 (25)]
X-Resent-Message-ID: <gIikWB.A.V_.ocQN4@ursula.gmcl.com>
X-Resent-From: wine-patches@winehq.com
X-Reply-To: wine-devel@winehq.com
X-Mailing-List: <wine-patches@winehq.com> archive/latest/2148
X-Loop: wine-patches@winehq.com
X-Precedence: list
X-Resent-Sender: wine-patches-request@winehq.com


--ELM942999323-16505-0_
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi !

OK, first Huw with the registry, now me with the profile handling :-\

Fixed a gross bug in PROFILE_Open:
Before making a newly opened file the current profile, not only
the oldest profile should be flushed, but also the *old* current profile !!

And nobody never ever found that bug. VERY strange...

Andreas Mohr

--ELM942999323-16505-0_
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename=diff.profile
Content-Description: /home/mohr/diff.profile
Content-Transfer-Encoding: 7bit

Index: files/profile.c
===================================================================
RCS file: /home/wine/wine/files/profile.c,v
retrieving revision 1.15
diff -u -w -r1.15 profile.c
--- files/profile.c	1999/10/31 17:32:57	1.15
+++ files/profile.c	1999/11/19 08:07:49
@@ -373,6 +373,7 @@
         return FALSE;
     }
 
+	TRACE("Trying to flush %s. [%d]\n", CurProfile->dos_name, CurProfile->changed);
     if (!CurProfile->changed || !CurProfile->dos_name) return TRUE;
     if (!(unix_name = CurProfile->unix_name) || !(file = fopen(unix_name, "w")))
     {
@@ -494,8 +495,10 @@
          }
       }
 
-    /* Rotate the oldest to the top to be replaced */
+	/* Flush the old current profile */
+	PROFILE_FlushFile();
 
+    /* Make the oldest profile the current one only in order to get rid of it */
     if(i==N_CACHED_PROFILES)
       {
        tempProfile=MRUProfile[N_CACHED_PROFILES-1];
@@ -503,11 +506,9 @@
           MRUProfile[i]=MRUProfile[i-1];
        CurProfile=tempProfile;
       }
-
-    /* Flush the profile */
-
     if(CurProfile->filename) PROFILE_ReleaseFile();
 
+	/* OK, now that CurProfile is definitely free we assign it our new file */
     newdos_name = HEAP_strdupA( SystemHeap, 0, full_name.short_name );
     CurProfile->dos_name  = newdos_name;
     CurProfile->filename  = HEAP_strdupA( SystemHeap, 0, filename );

--ELM942999323-16505-0_--

---
