Author: cfinck
Date: Wed Jul 2 11:07:01 2008
New Revision: 34266
URL: http://svn.reactos.org/svn/reactos?rev=34266&view=rev
Log:
Simplify the code for fputwc, when the file is opened in text mode.
I verified this behaviour with a test app under Windows XP SP2. This is also the code used by the fputwc function of our previous msvcrt.
Modified:
trunk/reactos/lib/sdk/crt/stdio/file.c
Modified: trunk/reactos/lib/sdk/crt/stdio/file.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/file.c?r…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] Wed Jul 2 11:07:01 2008
@@ -2475,24 +2475,20 @@
*/
wint_t CDECL fputwc(wint_t wc, FILE* file)
{
- wchar_t mwc=wc;
- char mbchar[10]; // MB_CUR_MAX_CONST
- int mb_return;
-
if (file->_flag & _IOBINARY)
{
+ wchar_t mwc = wc;
+
if (fwrite( &mwc, sizeof(mwc), 1, file) != 1)
return WEOF;
}
else
{
- /* Convert to multibyte in text mode */
- mb_return = wctomb(mbchar, mwc);
- if (mb_return == -1) return WEOF;
-
- /* Output all characters */
- if (fwrite( mbchar, 1, mb_return, file) != 1)
- return WEOF;
+ /* Convert the character to ANSI */
+ char c = (unsigned char)wc;
+
+ if (fwrite( &c, sizeof(c), 1, file) != 1)
+ return WEOF;
}
return wc;
Author: janderwald
Date: Wed Jul 2 08:40:49 2008
New Revision: 34259
URL: http://svn.reactos.org/svn/reactos?rev=34259&view=rev
Log:
- don't trim spaces at the end of a value as it might be part of the value
- fixes the boot menu timeout text disalignment from bug 3437
- behaviour verified with Microsoft Windows Vista SP2+
Modified:
trunk/reactos/dll/win32/kernel32/misc/profile.c
Modified: trunk/reactos/dll/win32/kernel32/misc/profile.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/pr…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/profile.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/profile.c [iso-8859-1] Wed Jul 2 08:40:49 2008
@@ -435,7 +435,7 @@
/* 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) && ((szLineEnd[-1] == '\n') || (PROFILE_isspaceW(szLineEnd[-1]) && szLineEnd[-1] != ' '))) szLineEnd--;
if (szLineStart >= szLineEnd)
continue;