Michael Karcher : kernel32: Clean up PROFILE_isspaceW.

Alexandre Julliard julliard at winehq.org
Mon Sep 15 06:54:54 CDT 2008


Module: wine
Branch: master
Commit: fe09bc1a39cbcd3ef750830b3681a858eaafa91d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fe09bc1a39cbcd3ef750830b3681a858eaafa91d

Author: Michael Karcher <wine at mkarcher.dialup.fu-berlin.de>
Date:   Sun Sep 14 16:40:07 2008 +0200

kernel32: Clean up PROFILE_isspaceW.

---

 dlls/kernel32/profile.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index 22d4cb5..ab26533 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;
 




More information about the wine-cvs mailing list