[RESENT]Don't add empty lines when writing out profile files

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Jul 1 15:34:30 CDT 2003


Changelog:
	wine/files/profile.c: PROFILE_Save
	Don't add lines for empty sections
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/files/profile.c
===================================================================
RCS file: /home/wine/wine/files/profile.c,v
retrieving revision 1.86
diff -u -7 -r1.86 profile.c
--- wine/files/profile.c	30 Mar 2003 01:35:07 -0000	1.86
+++ wine/files/profile.c	6 May 2003 19:16:49 -0000
@@ -160,19 +160,18 @@
 static void PROFILE_Save( FILE *file, PROFILESECTION *section )
 {
     PROFILEKEY *key;
     char buffer[PROFILE_MAX_LINE_LEN];
 
     for ( ; section; section = section->next)
     {
-        if (section->name[0])
-        {
-            WideCharToMultiByte(CP_ACP, 0, section->name, -1, buffer, sizeof(buffer), NULL, NULL);
-            fprintf( file, "\r\n[%s]\r\n", buffer );
-        }
+        if (!section->name[0])
+	    continue;
+	WideCharToMultiByte(CP_ACP, 0, section->name, -1, buffer, sizeof(buffer), NULL, NULL);
+	fprintf( file, "[%s]\r\n", buffer );
         for (key = section->key; key; key = key->next)
         {
             WideCharToMultiByte(CP_ACP, 0, key->name, -1, buffer, sizeof(buffer), NULL, NULL);
             fprintf( file, "%s", buffer );
             if (key->value)
             {
                  WideCharToMultiByte(CP_ACP, 0, key->value, -1, buffer, sizeof(buffer), NULL, NULL);



More information about the wine-patches mailing list