Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1ae475da
Commit
1ae475da
authored
Jun 26, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix ungetc on files with empty buffer.
parent
f91f24f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
file.c
dlls/msvcrt/file.c
+8
-2
No files found.
dlls/msvcrt/file.c
View file @
1ae475da
...
...
@@ -4859,12 +4859,17 @@ int CDECL MSVCRT_printf_s(const char *format, ...)
*/
int
CDECL
MSVCRT_ungetc
(
int
c
,
MSVCRT_FILE
*
file
)
{
if
(
c
==
MSVCRT_EOF
)
if
(
!
MSVCRT_CHECK_PMT
(
file
!=
NULL
))
return
MSVCRT_EOF
;
if
(
c
==
MSVCRT_EOF
||
!
(
file
->
_flag
&
MSVCRT__IOREAD
||
(
file
->
_flag
&
MSVCRT__IORW
&&
!
(
file
->
_flag
&
MSVCRT__IOWRT
))))
return
MSVCRT_EOF
;
MSVCRT__lock_file
(
file
);
if
(
file
->
_bufsiz
==
0
&&
msvcrt_alloc_buffer
(
file
))
if
((
!
file
->
_bufsiz
&&
msvcrt_alloc_buffer
(
file
))
||
(
!
file
->
_cnt
&&
file
->
_ptr
==
file
->
_base
))
file
->
_ptr
++
;
if
(
file
->
_ptr
>
file
->
_base
)
{
file
->
_ptr
--
;
if
(
file
->
_flag
&
MSVCRT__IOSTRG
)
{
...
...
@@ -4878,6 +4883,7 @@ int CDECL MSVCRT_ungetc(int c, MSVCRT_FILE * file)
}
file
->
_cnt
++
;
MSVCRT_clearerr
(
file
);
file
->
_flag
|=
MSVCRT__IOREAD
;
MSVCRT__unlock_file
(
file
);
return
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