Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
a42bf013
Commit
a42bf013
authored
Apr 24, 2011
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: ungetc must create a buffer, even if _IONBF has been set with setvbuf.
parent
dc9904a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
12 deletions
+1
-12
file.c
dlls/msvcrt/file.c
+1
-1
file.c
dlls/msvcrt/tests/file.c
+0
-11
No files found.
dlls/msvcrt/file.c
View file @
a42bf013
...
...
@@ -3622,7 +3622,7 @@ int CDECL MSVCRT_ungetc(int c, MSVCRT_FILE * file)
{
if
(
c
==
MSVCRT_EOF
)
return
MSVCRT_EOF
;
if
(
file
->
_bufsiz
==
0
&&
!
(
file
->
_flag
&
MSVCRT__IONBF
)
)
{
if
(
file
->
_bufsiz
==
0
)
{
msvcrt_alloc_buffer
(
file
);
file
->
_ptr
++
;
}
...
...
dlls/msvcrt/tests/file.c
View file @
a42bf013
...
...
@@ -140,23 +140,12 @@ static void test_fileops( void )
ok
(
feof
(
file
),
"feof after ungetc(EOF) did not return EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
((
c
=
fgetc
(
file
))
==
EOF
,
"getc did not return EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
c
=
outbuffer
[
sizeof
(
outbuffer
)
-
1
];
if
(
bufmodes
[
bufmode
]
==
_IONBF
)
todo_wine
{
ok
(
ungetc
(
c
,
file
)
==
c
,
"ungetc did not return its input for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
(
!
feof
(
file
),
"feof after ungetc returned EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
((
c
=
fgetc
(
file
))
!=
EOF
,
"getc after ungetc returned EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
(
c
==
outbuffer
[
sizeof
(
outbuffer
)
-
1
],
"getc did not return ungetc'd data for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
(
!
feof
(
file
),
"feof after getc returned EOF prematurely for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
}
else
{
ok
(
ungetc
(
c
,
file
)
==
c
,
"ungetc did not return its input for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
(
!
feof
(
file
),
"feof after ungetc returned EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
((
c
=
fgetc
(
file
))
!=
EOF
,
"getc after ungetc returned EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
(
c
==
outbuffer
[
sizeof
(
outbuffer
)
-
1
],
"getc did not return ungetc'd data for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
(
!
feof
(
file
),
"feof after getc returned EOF prematurely for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
}
ok
((
c
=
fgetc
(
file
))
==
EOF
,
"getc did not return EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
ok
(
feof
(
file
),
"feof after getc did not return EOF for bufmode=%x
\n
"
,
bufmodes
[
bufmode
]);
...
...
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