patch fixing profile writing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



it may not be the best solution ...

Bug Description:
Reading an ini file works perfectly but whenever a key is modified
the file written is incorrect (since this forces flushing to disk) :
the actual code adds empty sections ([]) to the file.

Cause: (see wine/files/profile.c):
The first section created by PROFILE_Load() (which reads the
ini file) is an empty one (first_section->name[0]=0), and PROFILE_Save()
saves this to disk.

Remedy:
Do not save empty sections :

diff -ur wine-20011108/files/profile.c mywine/files/profile.c
--- wine-20011108/files/profile.c    Thu Jan  3 14:13:30 2002
+++ mywine/files/profile.c    Thu Jan  3 14:41:56 2002
@@ -145,7 +145,7 @@

     for ( ; section; section = section->next)
     {
-        if (section->name) fprintf( file, "\r\n[%s]\r\n", section->name );
+        if (section->name && section->name[0]) fprintf( file, 
"\r\n[%s]\r\n", section->name );
         for (key = section->key; key; key = key->next)
         {
             fprintf( file, "%s", key->name );

Remark:
Win2K and Win98 allows the creation of empty sections ([]), this is not
handled by my patch nor by the actual version of wine (bugguy).
I have not seen any application relying on this feature ...

Thanks,
Mehmet YASAR





[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux