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
a7e1c22a
Commit
a7e1c22a
authored
Sep 28, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Sep 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Avoid reading char by char from console.
parent
b4430319
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
batch.c
programs/cmd/batch.c
+13
-3
No files found.
programs/cmd/batch.c
View file @
a7e1c22a
...
...
@@ -181,13 +181,23 @@ WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where, WCHAR **end) {
* the LF (or CRLF) from the line.
*/
WCHAR
*
WCMD_fgets
(
WCHAR
*
s
,
int
noChars
,
HANDLE
h
)
{
DWORD
bytes
;
WCHAR
*
WCMD_fgets
(
WCHAR
*
s
,
int
noChars
,
HANDLE
h
)
{
DWORD
bytes
,
charsRead
;
BOOL
status
;
WCHAR
*
p
;
p
=
s
;
if
((
status
=
ReadConsoleW
(
h
,
s
,
noChars
,
&
charsRead
,
NULL
)))
{
s
[
charsRead
-
2
]
=
'\0'
;
/* Strip \r\n */
return
p
;
}
/* Continue only if we have no console (i.e. a file) handle */
if
(
GetLastError
()
!=
ERROR_INVALID_HANDLE
)
return
NULL
;
/* TODO: More intelligent buffering for reading lines from files */
do
{
status
=
WCMD_ReadFile
(
h
,
s
,
1
,
&
bytes
,
NULL
);
if
((
status
==
0
)
||
((
bytes
==
0
)
&&
(
s
==
p
)))
return
NULL
;
...
...
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