Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fvwrite.c')
-rw-r--r--newlib/libc/stdio/fvwrite.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c
index fc7995103..add48ba99 100644
--- a/newlib/libc/stdio/fvwrite.c
+++ b/newlib/libc/stdio/fvwrite.c
@@ -70,21 +70,43 @@ __sfvwrite_r (struct _reent *ptr,
len = 0;
#ifdef __SCLE
+ /* This only affects Cygwin, so calling __sputc_r *and* __swputc_r
+ * from here doesn't matter.
+ */
if (fp->_flags & __SCLE) /* text mode */
{
- do
- {
- GETIOV (;);
- while (len > 0)
- {
- if (__sputc_r (ptr, *p, fp) == EOF)
- return EOF;
- p++;
- len--;
- uio->uio_resid--;
- }
- }
- while (uio->uio_resid > 0);
+ if (fp->_flags2 & __SWID)
+ {
+ do
+ {
+ GETIOV (;);
+ while (len > 0)
+ {
+ if (__swputc_r (ptr, *p, fp) == EOF)
+ return EOF;
+ p++;
+ len--;
+ uio->uio_resid--;
+ }
+ }
+ while (uio->uio_resid > 0);
+ }
+ else
+ {
+ do
+ {
+ GETIOV (;);
+ while (len > 0)
+ {
+ if (__sputc_r (ptr, *p, fp) == EOF)
+ return EOF;
+ p++;
+ len--;
+ uio->uio_resid--;
+ }
+ }
+ while (uio->uio_resid > 0);
+ }
return 0;
}
#endif