Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2ee5323a
Commit
2ee5323a
authored
Jan 29, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't make stdout and stderr bufferred when writing to console.
parent
f824e200
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
33 deletions
+34
-33
file.c
dlls/msvcrt/file.c
+34
-33
No files found.
dlls/msvcrt/file.c
View file @
2ee5323a
...
...
@@ -560,20 +560,39 @@ static int msvcrt_flush_buffer(MSVCRT_FILE* file)
return
0
;
}
/*********************************************************************
* _isatty (MSVCRT.@)
*/
int
CDECL
MSVCRT__isatty
(
int
fd
)
{
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
hand
);
if
(
hand
==
INVALID_HANDLE_VALUE
)
return
0
;
return
GetFileType
(
hand
)
==
FILE_TYPE_CHAR
?
1
:
0
;
}
/* INTERNAL: Allocate stdio file buffer */
static
void
msvcrt_alloc_buffer
(
MSVCRT_FILE
*
file
)
static
BOOL
msvcrt_alloc_buffer
(
MSVCRT_FILE
*
file
)
{
file
->
_base
=
MSVCRT_calloc
(
MSVCRT_BUFSIZ
,
1
);
if
(
file
->
_base
)
{
file
->
_bufsiz
=
MSVCRT_BUFSIZ
;
file
->
_flag
|=
MSVCRT__IOMYBUF
;
}
else
{
file
->
_base
=
(
char
*
)(
&
file
->
_charbuf
);
/* put here 2 ??? */
file
->
_bufsiz
=
sizeof
(
file
->
_charbuf
);
}
file
->
_ptr
=
file
->
_base
;
file
->
_cnt
=
0
;
if
((
file
->
_file
==
MSVCRT_STDOUT_FILENO
||
file
->
_file
==
MSVCRT_STDERR_FILENO
)
&&
MSVCRT__isatty
(
file
->
_file
))
return
FALSE
;
file
->
_base
=
MSVCRT_calloc
(
MSVCRT_BUFSIZ
,
1
);
if
(
file
->
_base
)
{
file
->
_bufsiz
=
MSVCRT_BUFSIZ
;
file
->
_flag
|=
MSVCRT__IOMYBUF
;
}
else
{
file
->
_base
=
(
char
*
)(
&
file
->
_charbuf
);
/* put here 2 ??? */
file
->
_bufsiz
=
sizeof
(
file
->
_charbuf
);
}
file
->
_ptr
=
file
->
_base
;
file
->
_cnt
=
0
;
return
TRUE
;
}
/* INTERNAL: Convert integer to base32 string (0-9a-v), 0 becomes "" */
...
...
@@ -1619,20 +1638,6 @@ MSVCRT_intptr_t CDECL MSVCRT__get_osfhandle(int fd)
}
/*********************************************************************
* _isatty (MSVCRT.@)
*/
int
CDECL
MSVCRT__isatty
(
int
fd
)
{
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
hand
);
if
(
hand
==
INVALID_HANDLE_VALUE
)
return
0
;
return
GetFileType
(
hand
)
==
FILE_TYPE_CHAR
?
1
:
0
;
}
/*********************************************************************
* _mktemp (MSVCRT.@)
*/
char
*
CDECL
MSVCRT__mktemp
(
char
*
pattern
)
...
...
@@ -3661,10 +3666,8 @@ MSVCRT_size_t CDECL MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nm
/* Fill the buffer on small reads.
* TODO: Use a better buffering strategy.
*/
if
(
!
file
->
_cnt
&&
size
*
nmemb
<=
MSVCRT_BUFSIZ
/
2
&&
!
(
file
->
_flag
&
MSVCRT__IONBF
))
{
if
(
file
->
_bufsiz
==
0
)
{
msvcrt_alloc_buffer
(
file
);
}
if
(
!
file
->
_cnt
&&
size
*
nmemb
<=
MSVCRT_BUFSIZ
/
2
&&
!
(
file
->
_flag
&
MSVCRT__IONBF
)
&&
(
file
->
_bufsiz
!=
0
||
msvcrt_alloc_buffer
(
file
)))
{
file
->
_cnt
=
MSVCRT__read
(
file
->
_file
,
file
->
_base
,
file
->
_bufsiz
);
file
->
_ptr
=
file
->
_base
;
i
=
(
file
->
_cnt
<
rcnt
)
?
file
->
_cnt
:
rcnt
;
...
...
@@ -4472,10 +4475,8 @@ int CDECL MSVCRT_ungetc(int c, MSVCRT_FILE * file)
return
MSVCRT_EOF
;
MSVCRT__lock_file
(
file
);
if
(
file
->
_bufsiz
==
0
)
{
msvcrt_alloc_buffer
(
file
);
if
(
file
->
_bufsiz
==
0
&&
msvcrt_alloc_buffer
(
file
))
file
->
_ptr
++
;
}
if
(
file
->
_ptr
>
file
->
_base
)
{
file
->
_ptr
--
;
*
file
->
_ptr
=
c
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment