Return the correct length when getting a complete section in

PROFILE_GetString.
This commit is contained in:
Mike McCormack 2002-07-01 18:12:47 +00:00 committed by Alexandre Julliard
parent 33817372fe
commit e921e4664d
1 changed files with 7 additions and 5 deletions

View File

@ -861,11 +861,13 @@ static INT PROFILE_GetString( LPCSTR section, LPCSTR key_name,
/* no "else" here ! */
if (section && section[0])
{
PROFILE_GetSection(CurProfile->section, section, buffer, len,
FALSE, FALSE);
if (!buffer[0]) /* no luck -> def_val */
PROFILE_CopyEntry(buffer, def_val, len, FALSE);
return strlen(buffer);
INT ret = PROFILE_GetSection(CurProfile->section, section, buffer, len, FALSE, FALSE);
if (!buffer[0]) /* no luck -> def_val */
{
PROFILE_CopyEntry(buffer, def_val, len, FALSE);
ret = strlen(buffer);
}
return ret;
}
buffer[0] = '\0';
return 0;