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
0d169658
Commit
0d169658
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: read_i should pull in LF after CR only in unbuffered mode.
parent
92ac665d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
file.c
dlls/msvcrt/file.c
+10
-2
file.c
dlls/msvcrt/tests/file.c
+17
-1
No files found.
dlls/msvcrt/file.c
View file @
0d169658
...
...
@@ -1786,8 +1786,16 @@ static int read_i(int fd, void *buf, unsigned int count)
DWORD
i
,
j
;
if
(
bufstart
[
num_read
-
1
]
==
'\r'
)
{
MSVCRT_fdesc
[
fd
].
wxflag
|=
WX_READCR
;
num_read
--
;
if
(
count
==
1
)
{
MSVCRT_fdesc
[
fd
].
wxflag
&=
~
WX_READCR
;
ReadFile
(
hand
,
bufstart
,
1
,
&
num_read
,
NULL
);
}
else
{
MSVCRT_fdesc
[
fd
].
wxflag
|=
WX_READCR
;
num_read
--
;
}
}
else
MSVCRT_fdesc
[
fd
].
wxflag
&=
~
WX_READCR
;
...
...
dlls/msvcrt/tests/file.c
View file @
0d169658
...
...
@@ -880,7 +880,23 @@ static void test_file_write_read( void )
"problems with _O_BINARY _write / _O_TEXT _read
\n
"
);
_close
(
tempfd
);
ret
=
_chmod
(
tempf
,
_S_IREAD
|
_S_IWRITE
);
/* test _read with single bytes. CR should be skipped and LF pulled in */
tempfd
=
_open
(
tempf
,
_O_RDONLY
|
_O_TEXT
);
/* open in TEXT mode */
for
(
i
=
0
;
i
<
strlen
(
mytext
);
i
++
)
/* */
{
_read
(
tempfd
,
btext
,
1
);
ok
(
btext
[
0
]
==
mytext
[
i
],
"_read failed at pos %d 0x%02x vs 0x%02x
\n
"
,
i
,
btext
[
0
],
mytext
[
i
]);
}
while
(
_read
(
tempfd
,
btext
,
1
));
_close
(
tempfd
);
/* test _read in buffered mode. Last CR should be skipped but LF not pulled in */
tempfd
=
_open
(
tempf
,
_O_RDONLY
|
_O_TEXT
);
/* open in TEXT mode */
i
=
_read
(
tempfd
,
btext
,
strlen
(
mytext
));
ok
(
i
==
strlen
(
mytext
)
-
1
,
"_read_i %d vs %d
\n
"
,
i
,
strlen
(
mytext
));
_close
(
tempfd
);
ret
=
_chmod
(
tempf
,
_S_IREAD
|
_S_IWRITE
);
ok
(
ret
==
0
,
"Can't chmod '%s' to read-write: %d
\n
"
,
tempf
,
errno
);
ret
=
unlink
(
tempf
);
...
...
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