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
92ac665d
Commit
92ac665d
authored
Jan 28, 2010
by
Uwe Bonnes
Committed by
Alexandre Julliard
Jan 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Check for EOF before correcting CR/LF.
parent
1d0db2b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
file.c
dlls/msvcrt/file.c
+9
-6
No files found.
dlls/msvcrt/file.c
View file @
92ac665d
...
...
@@ -1757,6 +1757,9 @@ static int read_i(int fd, void *buf, unsigned int count)
char
*
bufstart
=
buf
;
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
if
(
count
==
0
)
return
0
;
if
(
MSVCRT_fdesc
[
fd
].
wxflag
&
WX_READEOF
)
{
MSVCRT_fdesc
[
fd
].
wxflag
|=
WX_ATEOF
;
TRACE
(
"already at EOF, returning 0
\n
"
);
...
...
@@ -1773,7 +1776,12 @@ static int read_i(int fd, void *buf, unsigned int count)
*/
if
(
ReadFile
(
hand
,
bufstart
,
count
,
&
num_read
,
NULL
))
{
if
(
MSVCRT_fdesc
[
fd
].
wxflag
&
WX_TEXT
)
if
(
count
!=
0
&&
num_read
==
0
)
{
MSVCRT_fdesc
[
fd
].
wxflag
|=
(
WX_ATEOF
|
WX_READEOF
);
TRACE
(
":EOF %s
\n
"
,
debugstr_an
(
buf
,
num_read
));
}
else
if
(
MSVCRT_fdesc
[
fd
].
wxflag
&
WX_TEXT
)
{
DWORD
i
,
j
;
if
(
bufstart
[
num_read
-
1
]
==
'\r'
)
...
...
@@ -1802,11 +1810,6 @@ static int read_i(int fd, void *buf, unsigned int count)
}
num_read
=
j
;
}
if
(
count
!=
0
&&
num_read
==
0
)
{
MSVCRT_fdesc
[
fd
].
wxflag
|=
(
WX_ATEOF
|
WX_READEOF
);
TRACE
(
":EOF %s
\n
"
,
debugstr_an
(
buf
,
num_read
));
}
}
else
{
...
...
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