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
8e56d0fe
Commit
8e56d0fe
authored
Nov 02, 2023
by
Fabian Maurer
Committed by
Alexandre Julliard
Nov 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fsetpos resets EOF flag.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55856
parent
c9ff04c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
14 deletions
+45
-14
file.c
dlls/msvcrt/file.c
+1
-13
file.c
dlls/msvcrt/tests/file.c
+44
-1
No files found.
dlls/msvcrt/file.c
View file @
8e56d0fe
...
...
@@ -4682,19 +4682,7 @@ errno_t CDECL freopen_s(FILE** pFile,
*/
int
CDECL
fsetpos
(
FILE
*
file
,
fpos_t
*
pos
)
{
int
ret
;
_lock_file
(
file
);
msvcrt_flush_buffer
(
file
);
/* Reset direction of i/o */
if
(
file
->
_flag
&
_IORW
)
{
file
->
_flag
&=
~
(
_IOREAD
|
_IOWRT
);
}
ret
=
(
_lseeki64
(
file
->
_file
,
*
pos
,
SEEK_SET
)
==
-
1
)
?
-
1
:
0
;
_unlock_file
(
file
);
return
ret
;
return
_fseeki64
(
file
,
*
pos
,
SEEK_SET
);
}
/*********************************************************************
...
...
dlls/msvcrt/tests/file.c
View file @
8e56d0fe
...
...
@@ -226,7 +226,50 @@ static void test_fileops( void )
ok
(
fread
(
buffer
,
sizeof
(
buffer
),
1
,
file
)
==
0
,
"fread test failed
\n
"
);
/* feof should be set now */
ok
(
feof
(
file
),
"feof after fread failed
\n
"
);
fclose
(
file
);
clearerr
(
file
);
ok
(
!
feof
(
file
),
"feof after clearerr failed
\n
"
);
fclose
(
file
);
file
=
fopen
(
"fdopen.tst"
,
"rb"
);
ok
(
file
!=
NULL
,
"fopen failed
\n
"
);
/* sizeof(buffer) > content of file */
ok
(
fread
(
buffer
,
sizeof
(
buffer
),
1
,
file
)
==
0
,
"fread test failed
\n
"
);
/* feof should be set now */
ok
(
feof
(
file
),
"feof after fread failed
\n
"
);
rewind
(
file
);
ok
(
!
feof
(
file
),
"feof after rewind failed
\n
"
);
fclose
(
file
);
file
=
fopen
(
"fdopen.tst"
,
"rb"
);
ok
(
file
!=
NULL
,
"fopen failed
\n
"
);
/* sizeof(buffer) > content of file */
ok
(
fread
(
buffer
,
sizeof
(
buffer
),
1
,
file
)
==
0
,
"fread test failed
\n
"
);
/* feof should be set now */
ok
(
feof
(
file
),
"feof after fread failed
\n
"
);
fseek
(
file
,
0
,
SEEK_SET
);
ok
(
!
feof
(
file
),
"feof after fseek failed
\n
"
);
fclose
(
file
);
file
=
fopen
(
"fdopen.tst"
,
"rb"
);
ok
(
file
!=
NULL
,
"fopen failed
\n
"
);
/* sizeof(buffer) > content of file */
ok
(
fread
(
buffer
,
sizeof
(
buffer
),
1
,
file
)
==
0
,
"fread test failed
\n
"
);
/* feof should be set now */
ok
(
feof
(
file
),
"feof after fread failed
\n
"
);
fgetpos
(
file
,
&
pos
);
fsetpos
(
file
,
&
pos
);
ok
(
!
feof
(
file
),
"feof after fsetpos failed
\n
"
);
fclose
(
file
);
file
=
fopen
(
"fdopen.tst"
,
"rb"
);
ok
(
file
!=
NULL
,
"fopen failed
\n
"
);
/* sizeof(buffer) > content of file */
ok
(
fread
(
buffer
,
sizeof
(
buffer
),
1
,
file
)
==
0
,
"fread test failed
\n
"
);
/* feof should be set now */
ok
(
feof
(
file
),
"feof after fread failed
\n
"
);
fsetpos
(
file
,
&
pos
);
ok
(
!
feof
(
file
),
"feof after fsetpos failed
\n
"
);
fclose
(
file
);
unlink
(
"fdopen.tst"
);
}
...
...
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