From d4028b14b9055609d07b99e5a2d6a6a9ddf1798b Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Wed, 16 Mar 2011 14:08:30 +0000 Subject: [PATCH 1/1] Merge 51058, 51062-51063 svn path=/branches/ros-branch-0_3_13/; revision=51064 --- .../applications/rapps/rapps/firefox2.txt | 10 +----- .../applications/rapps/rapps/firefox3.txt | 10 +----- .../applications/rapps/rapps/firefox36.txt | 16 +++++----- .../rapps/rapps/openoffice2.4.txt | 12 +++---- .../applications/rapps/rapps/seamonkey.txt | 12 +++---- .../applications/rapps/rapps/thunderbird.txt | 14 ++++----- .../applications/rapps/rapps/winboard.txt | 2 +- reactos/lib/sdk/crt/printf/streamout.c | 23 +++----------- reactos/lib/sdk/crt/stdio/file.c | 31 ++++++++++++++++--- 9 files changed, 61 insertions(+), 69 deletions(-) diff --git a/reactos/base/applications/rapps/rapps/firefox2.txt b/reactos/base/applications/rapps/rapps/firefox2.txt index 816bf597e62..efb7f8b514c 100644 --- a/reactos/base/applications/rapps/rapps/firefox2.txt +++ b/reactos/base/applications/rapps/rapps/firefox2.txt @@ -8,45 +8,37 @@ Description = The most popular and one of the best free Web Browsers out there. Size = 5.8M Category = 5 URLSite = http://www.mozilla.com/en-US/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/en-US/Firefox%20Setup%202.0.0.20.exe +URLDownload = http://svn.reactos.org/packages/Firefox%20Setup%202.0.0.20.exe CDPath = none [Section.0405] Description = Nejpopulárnější a jeden z nejlepších svobodných webových prohlížečů. URLSite = http://www.mozilla-europe.org/cs/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/cs/Firefox%20Setup%202.0.0.20.exe [Section.0407] Description = Der populärste und einer der besten freien Webbrowser. URLSite = http://www.mozilla-europe.org/de/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/de/Firefox%20Setup%202.0.0.20.exe [Section.040a] Description = El más popular y uno de los mejores navegadores web gratuitos que hay. URLSite = http://www.mozilla-europe.org/es/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/es-ES/Firefox%20Setup%202.0.0.20.exe [Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. URLSite = http://www.mozilla-europe.org/fr/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/fr/Firefox%20Setup%202.0.0.20.exe [Section.0414] Description = Mest populære og best også gratis nettleserene der ute. URLSite = http://www.mozilla-europe.org/no/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/nb-NO/Firefox%20Setup%202.0.0.20.exe [Section.0415] Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. URLSite = http://www.mozilla-europe.org/pl/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/pl/Firefox%20Setup%202.0.0.20.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных браузеров. URLSite = http://www.mozilla-europe.org/ru/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/ru/Firefox%20Setup%202.0.0.20.exe [Section.0422] Description = Найпопулярніший та один з кращих безплатних веб-браузерів. URLSite = http://www.mozilla-europe.org/uk/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/uk/Firefox%20Setup%202.0.0.20.exe diff --git a/reactos/base/applications/rapps/rapps/firefox3.txt b/reactos/base/applications/rapps/rapps/firefox3.txt index 76855309d81..065202dd921 100644 --- a/reactos/base/applications/rapps/rapps/firefox3.txt +++ b/reactos/base/applications/rapps/rapps/firefox3.txt @@ -8,52 +8,44 @@ Description = The most popular and one of the best free Web Browsers out there. Size = 7.2M Category = 5 URLSite = http://www.mozilla.com/en-US/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/en-US/Firefox%20Setup%203.0.19.exe +URLDownload = http://svn.reactos.org/packages/Firefox%20Setup%203.0.19.exe CDPath = none [Section.0405] Description = Nejpopulárnější a jeden z nejlepších svobodných webových prohlížečů. Size = 7.0M URLSite = http://www.mozilla-europe.org/cs/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/cs/Firefox%20Setup%203.0.19.exe [Section.0407] Description = Der populärste und einer der besten freien Webbrowser. Size = 7.0M URLSite = http://www.mozilla-europe.org/de/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/de/Firefox%20Setup%203.0.19.exe [Section.040a] Description = El más popular y uno de los mejores navegadores web gratuitos que hay. Size = 7.0M URLSite = http://www.mozilla-europe.org/es/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/es-ES/Firefox%20Setup%203.0.19.exe [Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. URLSite = http://www.mozilla-europe.org/fr/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/fr/Firefox%20Setup%203.0.19.exe [Section.0414] Description = Mest populære og best også gratis nettleserene der ute. Size = 7.0M URLSite = http://www.mozilla-europe.org/no/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/nb-NO/Firefox%20Setup%203.0.19.exe [Section.0415] Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. Size = 7.9M URLSite = http://www.mozilla-europe.org/pl/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/pl/Firefox%20Setup%203.0.19.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных браузеров. Size = 7.8M URLSite = http://www.mozilla-europe.org/ru/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/ru/Firefox%20Setup%203.0.19.exe [Section.0422] Description = Найпопулярніший та один з кращих безплатних веб-браузерів. Size = 7.4M URLSite = http://www.mozilla-europe.org/uk/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/uk/Firefox%20Setup%203.0.19.exe diff --git a/reactos/base/applications/rapps/rapps/firefox36.txt b/reactos/base/applications/rapps/rapps/firefox36.txt index d8a96e71e56..4f5d3b8c96b 100644 --- a/reactos/base/applications/rapps/rapps/firefox36.txt +++ b/reactos/base/applications/rapps/rapps/firefox36.txt @@ -8,47 +8,47 @@ Description = The most popular and one of the best free Web Browsers out there. Size = 8.2M Category = 5 URLSite = http://www.mozilla.com/en-US/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/en-US/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/en-US/Firefox%20Setup%203.6.15.exe CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Webbrowser. Size = 8.1M URLSite = http://www.mozilla-europe.org/de/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/de/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/de/Firefox%20Setup%203.6.15.exe [Section.040a] Description = El más popular y uno de los mejores navegadores web gratuitos que hay. Size = 8.1M URLSite = http://www.mozilla-europe.org/es/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/es-ES/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/es-ES/Firefox%20Setup%203.6.15.exe [Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. Size = 8.1M URLSite = http://www.mozilla-europe.org/fr/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/fr/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/fr/Firefox%20Setup%203.6.15.exe [Section.0414] Description = Mest populære og best også gratis nettleserene der ute. Size = 8.1M URLSite = http://www.mozilla-europe.org/no/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/nb-NO/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/nb-NO/Firefox%20Setup%203.6.15.exe [Section.0415] Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. Size = 8.9M URLSite = http://www.mozilla-europe.org/pl/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/pl/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/pl/Firefox%20Setup%203.6.15.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных браузеров. Size = 8.5M URLSite = http://www.mozilla-europe.org/ru/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/ru/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/ru/Firefox%20Setup%203.6.15.exe [Section.0422] Description = Найпопулярніший та один з кращих безплатних веб-браузерів. Size = 8.5M URLSite = http://www.mozilla-europe.org/uk/ -URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/uk/Firefox%20Setup%203.6.15.exe +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.15/win32/uk/Firefox%20Setup%203.6.15.exe diff --git a/reactos/base/applications/rapps/rapps/openoffice2.4.txt b/reactos/base/applications/rapps/rapps/openoffice2.4.txt index f2bc9ec0578..907712013be 100644 --- a/reactos/base/applications/rapps/rapps/openoffice2.4.txt +++ b/reactos/base/applications/rapps/rapps/openoffice2.4.txt @@ -8,36 +8,36 @@ Description = THE Open Source Office Suite. Size = 127MB Category = 6 URLSite = http://www.openoffice.org/ -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/stable/2.4.3/OOo_2.4.3_Win32Intel_install_en-US.exe +URLDownload = http://archive.services.openoffice.org/pub/openoffice-archive/stable/2.4.3/OOo_2.4.3_Win32Intel_install_en-US.exe CDPath = none [Section.0407] Description = DIE Open Source Office Suite. URLSite = http://de.openoffice.org/ Size = 114.2MB -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/de/2.4.3/OOo_2.4.3_Win32Intel_install_de.exe +URLDownload = http://archive.services.openoffice.org/pub/openoffice-archive/localized/de/2.4.3/OOo_2.4.3_Win32Intel_install_de.exe [Section.040a] Description = La suite de ofimática de código abierto. URLSite = http://es.openoffice.org/ Size = 113.9MB -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/es/2.4.3/OOo_2.4.3_Win32Intel_install_es.exe +URLDownload = http://archive.services.openoffice.org/pub/openoffice-archive/localized/es/2.4.3/OOo_2.4.3_Win32Intel_install_es.exe [Section.040c] Version = 2.4.2 Description = LA suite bureautique open source. URLSite = http://fr.openoffice.org/ Size = 113.9MB -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/fr/2.4.2/OOo_2.4.2_Win32Intel_install_fr.exe +URLDownload = http://archive.services.openoffice.org/pub/openoffice-archive/localized/fr/2.4.2/OOo_2.4.2_Win32Intel_install_fr.exe [Section.0415] URLSite = http://pl.openoffice.org/ Description = Otwarty pakiet biurowy. -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/pl/2.4.2/OOo_2.4.2_Win32Intel_install_pl.exe +URLDownload = http://archive.services.openoffice.org/pub/openoffice-archive/localized/pl/2.4.2/OOo_2.4.2_Win32Intel_install_pl.exe Size = 113.9M [Section.0422] URLSite = http://ua.openoffice.org/ Description = Відкритий офісний пакет. -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/ru/2.4.3/OOo_2.4.3_Win32Intel_install_ru.exe +URLDownload = http://archive.services.openoffice.org/pub/openoffice-archive/localized/ru/2.4.3/OOo_2.4.3_Win32Intel_install_ru.exe Size = 114.8M diff --git a/reactos/base/applications/rapps/rapps/seamonkey.txt b/reactos/base/applications/rapps/rapps/seamonkey.txt index 82e5a0401ff..2564895cac8 100644 --- a/reactos/base/applications/rapps/rapps/seamonkey.txt +++ b/reactos/base/applications/rapps/rapps/seamonkey.txt @@ -8,30 +8,30 @@ Description = Mozilla Suite is alive. This is the one and only Browser, Mail, Ch Size = 10.2MB Category = 5 URLSite = http://www.seamonkey-project.org/ -URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/en-US/SeaMonkey%20Setup%202.0.12.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.12/win32/en-US/SeaMonkey%20Setup%202.0.12.exe CDPath = none [Section.0407] Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen. Size = 10.1MB -URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/de/SeaMonkey%20Setup%202.0.12.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.12/win32/de/SeaMonkey%20Setup%202.0.12.exe [Section.040a] Description = La suite de Mozilla está viva. Es el primero y único navegador web, gestor de correo, lector de noticias, Chat y editor HTML que necesitarás. Size = 10.1MB -URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/es-ES/SeaMonkey%20Setup%202.0.12.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.12/win32/es-ES/SeaMonkey%20Setup%202.0.12.exe [Section.040c] Description = La suite Mozilla est en vie. Ceci est le seul et l'unique package navigateur, client mail, client chat et composer dont vous aurez besoin. Size = 10.1MB -URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/fr/SeaMonkey%20Setup%202.0.12.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.12/win32/fr/SeaMonkey%20Setup%202.0.12.exe [Section.0415] Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz. Size = 11.0MB -URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/pl/SeaMonkey%20Setup%202.0.12.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.12/win32/pl/SeaMonkey%20Setup%202.0.12.exe [Section.0419] Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор. Size = 10.5MB -URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/ru/SeaMonkey%20Setup%202.0.12.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.12/win32/ru/SeaMonkey%20Setup%202.0.12.exe diff --git a/reactos/base/applications/rapps/rapps/thunderbird.txt b/reactos/base/applications/rapps/rapps/thunderbird.txt index 644933e5867..e91eb6c7182 100644 --- a/reactos/base/applications/rapps/rapps/thunderbird.txt +++ b/reactos/base/applications/rapps/rapps/thunderbird.txt @@ -8,41 +8,41 @@ Description = The most popular and one of the best free Mail Clients out there. Size = 9.0M Category = 5 URLSite = http://www.mozilla-europe.org/en/products/thunderbird/ -URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/en-US/Thunderbird%20Setup%203.1.9.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.9/win32/en-US/Thunderbird%20Setup%203.1.9.exe CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Mail-Clients. Size = 8.8M URLSite = http://www.mozilla-europe.org/de/products/thunderbird/ -URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/de/Thunderbird%20Setup%203.1.9.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.9/win32/de/Thunderbird%20Setup%203.1.9.exe [Section.040a] Description = El más popular y uno de los mejores clientes mail que hay. Size = 8.8M URLSite = http://www.mozilla-europe.org/es/products/thunderbird/ -URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/es-ES/Thunderbird%20Setup%203.1.9.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.9/win32/es-ES/Thunderbird%20Setup%203.1.9.exe [Section.040c] Description = Le plus populaire et l'un des meilleurs clients mail gratuits disponible. Size = 8.8M URLSite = http://www.mozilla-europe.org/fr/products/thunderbird/ -URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/fr/Thunderbird%20Setup%203.1.9.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.9/win32/fr/Thunderbird%20Setup%203.1.9.exe [Section.0415] Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty. Size = 9.7M URLSite = http://www.mozilla-europe.org/pl/products/thunderbird/ -URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/pl/Thunderbird%20Setup%203.1.9.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.9/win32/pl/Thunderbird%20Setup%203.1.9.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных почтовых клиентов. Size = 9.2M URLSite = http://www.mozilla-europe.org/ru/products/thunderbird/ -URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/ru/Thunderbird%20Setup%203.1.9.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.9/win32/ru/Thunderbird%20Setup%203.1.9.exe [Section.0422] Description = Найпопулярніший та один з кращих поштових клієнтів. Size = 9.2M URLSite = http://www.mozillamessaging.com/uk/thunderbird/ -URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/uk/Thunderbird%20Setup%203.1.9.exe +URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.9/win32/uk/Thunderbird%20Setup%203.1.9.exe diff --git a/reactos/base/applications/rapps/rapps/winboard.txt b/reactos/base/applications/rapps/rapps/winboard.txt index 9e58a153fd0..a7a0db6ffb5 100644 --- a/reactos/base/applications/rapps/rapps/winboard.txt +++ b/reactos/base/applications/rapps/rapps/winboard.txt @@ -8,7 +8,7 @@ Description = WinBoard is a graphical chessboard for the Windows/ReactOS that ca Size = 5.9MB Category = 4 URLSite = http://www.gnu.org/software/xboard/ -URLDownload = ftp://ftp.gnu.org/old-gnu/xboard/winboard/winboard-4_2_7b.exe +URLDownload = http://ftp.gnu.org/old-gnu/xboard/winboard/winboard-4_2_7b.exe CDPath = none [Section.0407] diff --git a/reactos/lib/sdk/crt/printf/streamout.c b/reactos/lib/sdk/crt/printf/streamout.c index 8e9ce4f667a..66aae271dd5 100644 --- a/reactos/lib/sdk/crt/printf/streamout.c +++ b/reactos/lib/sdk/crt/printf/streamout.c @@ -16,13 +16,6 @@ #ifdef _UNICODE # define streamout wstreamout # define format_float format_floatw -# define _flsbuf _flswbuf -int __cdecl _flswbuf(int ch, FILE *stream); -#endif - -#ifdef _LIBCNT_ -# undef _flsbuf -# define _flsbuf(chr, stream) _TEOF #endif #define MB_CUR_MAX 10 @@ -234,25 +227,19 @@ static int streamout_char(FILE *stream, int chr) { +#if defined(_USER32_WSPRINTF) || defined(_LIBCNT_) /* Check if the buffer is full */ if (stream->_cnt < sizeof(TCHAR)) - { -#ifdef _USER32_WSPRINTF - return _TEOF; -#else - /* Strings are done now */ - if (stream->_flag & _IOSTRG) return _TEOF; - - /* Flush buffer for files */ - return _flsbuf(chr, stream) != _TEOF; -#endif - } + return 0; *(TCHAR*)stream->_ptr = chr; stream->_ptr += sizeof(TCHAR); stream->_cnt -= sizeof(TCHAR); return 1; +#else + return _fputtc((TCHAR)chr, stream) != _TEOF; +#endif } static diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index a66da9de9d4..cb5f5ae3dd8 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -2175,12 +2175,33 @@ size_t CDECL fwrite(const void *ptr, size_t size, size_t nmemb, FILE* file) /********************************************************************* * fputwc (MSVCRT.@) */ -wint_t CDECL fputwc(wint_t wc, FILE* file) +wint_t CDECL fputwc(wchar_t c, FILE* stream) { - wchar_t mwc=wc; - if (fwrite( &mwc, sizeof(mwc), 1, file) != 1) - return WEOF; - return wc; + /* If this is a real file stream (and not some temporary one for + sprintf-like functions), check whether it is opened in text mode. + In this case, we have to perform an implicit conversion to ANSI. */ + if (!(stream->_flag & _IOSTRG) && fdesc[stream->_file].wxflag & WX_TEXT) + { + /* Convert to multibyte in text mode */ + char mbc[MB_LEN_MAX]; + int mb_return; + + mb_return = wctomb(mbc, c); + + if(mb_return == -1) + return WEOF; + + /* Output all characters */ + if (fwrite(mbc, mb_return, 1, stream) != 1) + return WEOF; + } + else + { + if (fwrite(&c, sizeof(c), 1, stream) != 1) + return WEOF; + } + + return c; } /********************************************************************* -- 2.17.1