From a56eadc92d873fede49654eb9dde11390b398abb Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 3 May 2004 20:18:43 +0000 Subject: [PATCH] Strip leading whitespace when adding a new value and not just when replacing a current value. --- dlls/kernel/profile.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/kernel/profile.c b/dlls/kernel/profile.c index 92dd1bf0446..83ff47a972b 100644 --- a/dlls/kernel/profile.c +++ b/dlls/kernel/profile.c @@ -993,12 +993,13 @@ static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name, TRACE("(%s,%s,%s):\n", debugstr_w(section_name), debugstr_w(key_name), debugstr_w(value) ); if (!key) return FALSE; + + /* strip the leading spaces. We can safely strip \n\r and + * friends too, they should not happen here anyway. */ + while (PROFILE_isspaceW(*value)) value++; + if (key->value) { - /* strip the leading spaces. We can safely strip \n\r and - * friends too, they should not happen here anyway. */ - while (PROFILE_isspaceW(*value)) value++; - if (!strcmpW( key->value, value )) { TRACE(" no change needed\n" );