Commit 00ced5e3 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Fix regression in GetPrivateProfileSection for lines without an '='.

Add test.
parent 486fd1f6
......@@ -863,7 +863,7 @@ static INT PROFILE_GetSection( PROFILESECTION *section, LPCWSTR section_name,
if (len <= 2) break;
if (!*key->name) continue; /* Skip empty lines */
if (IS_ENTRY_COMMENT(key->name)) continue; /* Skip comments */
if (!key->value) continue; /* Skip lines w.o. '=' */
if (!return_values && !key->value) continue; /* Skip lines w.o. '=' */
PROFILE_CopyEntry( buffer, key->name, len - 1, 0 );
len -= strlenW(buffer) + 1;
buffer += strlenW(buffer) + 1;
......
......@@ -114,6 +114,14 @@ void test_profile_string()
/* and test */
ok( !strcmp( buf, "name1,name2,name4"), "wrong keys returned: %s\n",
buf);
ret=GetPrivateProfileSectionA("s", buf, sizeof(buf), TESTFILE2);
for( p = buf + strlen(buf) + 1; *p;p += strlen(p)+1)
p[-1] = ',';
/* and test */
ok( !strcmp( buf, "name1=val1,name2=,name3,name4=val4"), "wrong section returned: %s\n",
buf);
/* add a new key to test that the file is quite usable */
WritePrivateProfileStringA( "s", "name5", "val5", TESTFILE2);
ret=GetPrivateProfileStringA( "s", NULL, "", buf, sizeof(buf),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment