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
cac27a40
Commit
cac27a40
authored
Aug 10, 2015
by
Iván Matellanes
Committed by
Alexandre Julliard
Aug 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcirt: Allocate a buffer if necessary when a file is opened.
parent
c4cd981a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
msvcirt.c
dlls/msvcirt/msvcirt.c
+1
-0
msvcirt.c
dlls/msvcirt/tests/msvcirt.c
+2
-0
No files found.
dlls/msvcirt/msvcirt.c
View file @
cac27a40
...
...
@@ -973,6 +973,7 @@ filebuf* __thiscall filebuf_open(filebuf *this, const char *name, ios_open_mode
_close
(
fd
);
}
else
this
->
fd
=
fd
;
streambuf_allocate
(
&
this
->
base
);
streambuf_unlock
(
&
this
->
base
);
return
(
this
->
fd
==
-
1
)
?
NULL
:
this
;
}
...
...
dlls/msvcirt/tests/msvcirt.c
View file @
cac27a40
...
...
@@ -1016,9 +1016,11 @@ static void test_filebuf(void)
pret
=
(
filebuf
*
)
call_func4
(
p_filebuf_open
,
&
fb1
,
filename1
,
OPENMODE_ate
|
OPENMODE_nocreate
|
OPENMODE_noreplace
|
OPENMODE_binary
,
filebuf_openprot
);
ok
(
pret
==
NULL
,
"wrong return, expected %p got %p
\n
"
,
NULL
,
pret
);
ok
(
fb1
.
base
.
allocated
==
0
,
"wrong allocate value, expected 0 got %d
\n
"
,
fb1
.
base
.
allocated
);
fb1
.
base
.
do_lock
=
0
;
pret
=
(
filebuf
*
)
call_func4
(
p_filebuf_open
,
&
fb1
,
filename1
,
OPENMODE_out
,
filebuf_openprot
);
ok
(
pret
==
&
fb1
,
"wrong return, expected %p got %p
\n
"
,
&
fb1
,
pret
);
ok
(
fb1
.
base
.
allocated
==
1
,
"wrong allocate value, expected 1 got %d
\n
"
,
fb1
.
base
.
allocated
);
ok
(
_write
(
fb1
.
fd
,
"testing"
,
7
)
==
7
,
"_write failed
\n
"
);
pret
=
(
filebuf
*
)
call_func1
(
p_filebuf_close
,
&
fb1
);
ok
(
pret
==
&
fb1
,
"wrong return, expected %p got %p
\n
"
,
&
fb1
,
pret
);
...
...
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