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
516bb0ba
Commit
516bb0ba
authored
Mar 27, 2012
by
Robert van Herk
Committed by
Alexandre Julliard
Mar 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix file mode T (temporary file).
parent
342fcb61
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
file.c
dlls/msvcrt/file.c
+7
-1
file.c
dlls/msvcrt/tests/file.c
+32
-0
No files found.
dlls/msvcrt/file.c
View file @
516bb0ba
...
...
@@ -1281,10 +1281,16 @@ static int msvcrt_get_flags(const MSVCRT_wchar_t* mode, int *open_flags, int* st
*
open_flags
|=
MSVCRT__O_BINARY
;
*
open_flags
&=
~
MSVCRT__O_TEXT
;
break
;
case
'
T'
:
case
'
t'
:
case
't'
:
*
open_flags
|=
MSVCRT__O_TEXT
;
*
open_flags
&=
~
MSVCRT__O_BINARY
;
break
;
case
'D'
:
*
open_flags
|=
MSVCRT__O_TEMPORARY
;
break
;
case
'T'
:
*
open_flags
|=
MSVCRT__O_SHORT_LIVED
;
break
;
case
'+'
:
case
' '
:
break
;
...
...
dlls/msvcrt/tests/file.c
View file @
516bb0ba
...
...
@@ -434,6 +434,37 @@ static void test_asciimode2(void)
unlink
(
"ascii2.tst"
);
}
static
void
test_filemodeT
(
void
)
{
char
DATA
[]
=
{
26
,
't'
,
'e'
,
's'
,
't'
};
char
DATA2
[
100
];
char
temppath
[
MAX_PATH
];
char
tempfile
[
MAX_PATH
];
FILE
*
f
;
size_t
bytesWritten
;
size_t
bytesRead
;
WIN32_FIND_DATA
findData
;
HANDLE
h
;
GetTempPath
(
MAX_PATH
,
temppath
);
GetTempFileName
(
temppath
,
""
,
0
,
tempfile
);
f
=
fopen
(
tempfile
,
"w+bDT"
);
bytesWritten
=
fwrite
(
DATA
,
1
,
sizeof
(
DATA
),
f
);
rewind
(
f
);
bytesRead
=
fread
(
DATA2
,
1
,
sizeof
(
DATA2
),
f
);
fclose
(
f
);
ok
(
bytesRead
==
bytesWritten
&&
bytesRead
==
sizeof
(
DATA
),
"fopen file mode 'T' wrongly interpreted as 't'
\n
"
);
h
=
FindFirstFile
(
tempfile
,
&
findData
);
ok
(
h
==
INVALID_HANDLE_VALUE
,
"file wasn't deleted when closed.
\n
"
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
FindClose
(
h
);
}
static
WCHAR
*
AtoW
(
const
char
*
p
)
{
WCHAR
*
buffer
;
...
...
@@ -1628,6 +1659,7 @@ START_TEST(file)
test_fileops
();
test_asciimode
();
test_asciimode2
();
test_filemodeT
();
test_readmode
(
FALSE
);
/* binary mode */
test_readmode
(
TRUE
);
/* ascii mode */
test_readboundary
();
...
...
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