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
2ecb8713
Commit
2ecb8713
authored
Dec 01, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Don't use WCMD_is_console_handle.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54035a21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
10 deletions
+4
-10
batch.c
programs/cmd/batch.c
+2
-3
wcmd.h
programs/cmd/wcmd.h
+0
-4
wcmdmain.c
programs/cmd/wcmdmain.c
+2
-3
No files found.
programs/cmd/batch.c
View file @
2ecb8713
...
...
@@ -249,7 +249,7 @@ WCHAR *WCMD_fgets(WCHAR *buf, DWORD noChars, HANDLE h)
/* We can't use the native f* functions because of the filename syntax differences
between DOS and Unix. Also need to lose the LF (or CRLF) from the line. */
if
(
!
WCMD_is_console_handle
(
h
))
{
if
(
!
ReadConsoleW
(
h
,
buf
,
noChars
,
&
charsRead
,
NULL
))
{
LARGE_INTEGER
filepos
;
char
*
bufA
;
UINT
cp
;
...
...
@@ -282,8 +282,7 @@ WCHAR *WCMD_fgets(WCHAR *buf, DWORD noChars, HANDLE h)
heap_free
(
bufA
);
}
else
{
status
=
WCMD_ReadFile
(
h
,
buf
,
noChars
,
&
charsRead
);
if
(
!
status
||
charsRead
==
0
)
return
NULL
;
if
(
!
charsRead
)
return
NULL
;
/* Find first EOL */
for
(
i
=
0
;
i
<
charsRead
;
i
++
)
{
...
...
programs/cmd/wcmd.h
View file @
2ecb8713
...
...
@@ -105,10 +105,6 @@ void WCMD_version (void);
int
WCMD_volume
(
BOOL
set_label
,
const
WCHAR
*
args
);
void
WCMD_mklink
(
WCHAR
*
args
);
static
inline
BOOL
WCMD_is_console_handle
(
HANDLE
h
)
{
return
(((
DWORD_PTR
)
h
)
&
3
)
==
3
;
}
WCHAR
*
WCMD_fgets
(
WCHAR
*
buf
,
DWORD
n
,
HANDLE
stream
);
WCHAR
*
WCMD_parameter
(
WCHAR
*
s
,
int
n
,
WCHAR
**
start
,
BOOL
raw
,
BOOL
wholecmdline
);
WCHAR
*
WCMD_parameter_with_delims
(
WCHAR
*
s
,
int
n
,
WCHAR
**
start
,
BOOL
raw
,
...
...
programs/cmd/wcmdmain.c
View file @
2ecb8713
...
...
@@ -221,9 +221,8 @@ BOOL WCMD_ReadFile(const HANDLE hIn, WCHAR *intoBuf, const DWORD maxChars, LPDWO
DWORD
numRead
;
char
*
buffer
;
if
(
WCMD_is_console_handle
(
hIn
))
/* Try to read from console as Unicode */
return
ReadConsoleW
(
hIn
,
intoBuf
,
maxChars
,
charsRead
,
NULL
);
/* Try to read from console as Unicode */
if
(
ReadConsoleW
(
hIn
,
intoBuf
,
maxChars
,
charsRead
,
NULL
))
return
TRUE
;
/* We assume it's a file handle and read then convert from assumed OEM codepage */
if
(
!
(
buffer
=
get_file_buffer
()))
...
...
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