From fe09bc1a39cbcd3ef750830b3681a858eaafa91d Mon Sep 17 00:00:00 2001 From: Michael Karcher Date: Sun, 14 Sep 2008 16:40:07 +0200 Subject: [PATCH] kernel32: Clean up PROFILE_isspaceW. --- dlls/kernel32/profile.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index 22d4cb5e284..ab26533db35 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -272,10 +272,8 @@ static void PROFILE_Free( PROFILESECTION *section ) /* returns 1 if a character white space else 0 */ static inline int PROFILE_isspaceW(WCHAR c) { - if (isspaceW(c)) return 1; - if (c=='\r' || c==0x1a) return 1; - /* CR and ^Z (DOS EOF) are spaces too (found on CD-ROMs) */ - return 0; + /* ^Z (DOS EOF) is a space too (found on CD-ROMs) */ + return isspaceW(c) || c == 0x1a; } static inline ENCODING PROFILE_DetectTextEncoding(const void * buffer, int * len) @@ -415,7 +413,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) /* get rid of white space */ while (szLineStart < szLineEnd && PROFILE_isspaceW(*szLineStart)) szLineStart++; - while ((szLineEnd > szLineStart) && ((szLineEnd[-1] == '\n') || PROFILE_isspaceW(szLineEnd[-1]))) szLineEnd--; + while ((szLineEnd > szLineStart) && PROFILE_isspaceW(szLineEnd[-1])) szLineEnd--; if (szLineStart >= szLineEnd) continue;