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
29b57ca8
Commit
29b57ca8
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: Get rid of unused parameter in WCMD_ReadFile.
parent
d6f4f730
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
28 deletions
+17
-28
batch.c
programs/cmd/batch.c
+1
-1
builtins.c
programs/cmd/builtins.c
+11
-18
wcmd.h
programs/cmd/wcmd.h
+1
-2
wcmdmain.c
programs/cmd/wcmdmain.c
+4
-7
No files found.
programs/cmd/batch.c
View file @
29b57ca8
...
@@ -197,7 +197,7 @@ WCHAR *WCMD_fgets(WCHAR *s, int noChars, HANDLE h, BOOL is_console_handle)
...
@@ -197,7 +197,7 @@ WCHAR *WCMD_fgets(WCHAR *s, int noChars, HANDLE h, BOOL is_console_handle)
/* TODO: More intelligent buffering for reading lines from files */
/* TODO: More intelligent buffering for reading lines from files */
do
{
do
{
status
=
WCMD_ReadFile
(
h
,
s
,
1
,
&
bytes
,
NULL
);
status
=
WCMD_ReadFile
(
h
,
s
,
1
,
&
bytes
);
if
((
status
==
0
)
||
((
bytes
==
0
)
&&
(
s
==
p
)))
return
NULL
;
if
((
status
==
0
)
||
((
bytes
==
0
)
&&
(
s
==
p
)))
return
NULL
;
if
(
*
s
==
'\n'
)
bytes
=
0
;
if
(
*
s
==
'\n'
)
bytes
=
0
;
else
if
(
*
s
!=
'\r'
)
{
else
if
(
*
s
!=
'\r'
)
{
...
...
programs/cmd/builtins.c
View file @
29b57ca8
...
@@ -115,8 +115,7 @@ static BOOL WCMD_ask_confirm (const WCHAR *message, BOOL showSureText,
...
@@ -115,8 +115,7 @@ static BOOL WCMD_ask_confirm (const WCHAR *message, BOOL showSureText,
WCMD_output_asis
(
Abuffer
);
WCMD_output_asis
(
Abuffer
);
}
}
WCMD_output_asis
(
endBkt
);
WCMD_output_asis
(
endBkt
);
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
answer
,
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
answer
,
sizeof
(
answer
)
/
sizeof
(
WCHAR
),
&
count
);
sizeof
(
answer
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
answer
[
0
]
=
toupperW
(
answer
[
0
]);
answer
[
0
]
=
toupperW
(
answer
[
0
]);
}
}
...
@@ -306,7 +305,7 @@ void WCMD_choice (const WCHAR * command) {
...
@@ -306,7 +305,7 @@ void WCMD_choice (const WCHAR * command) {
while
(
TRUE
)
{
while
(
TRUE
)
{
/* FIXME: Add support for option /T */
/* FIXME: Add support for option /T */
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
answer
,
1
,
&
count
,
NULL
);
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
answer
,
1
,
&
count
);
if
(
!
opt_s
)
if
(
!
opt_s
)
answer
[
0
]
=
toupperW
(
answer
[
0
]);
answer
[
0
]
=
toupperW
(
answer
[
0
]);
...
@@ -1697,8 +1696,7 @@ void WCMD_pause (void) {
...
@@ -1697,8 +1696,7 @@ void WCMD_pause (void) {
WCHAR
string
[
32
];
WCHAR
string
[
32
];
WCMD_output
(
anykey
);
WCMD_output
(
anykey
);
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
);
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
}
}
/****************************************************************************
/****************************************************************************
...
@@ -2146,8 +2144,7 @@ void WCMD_setshow_date (void) {
...
@@ -2146,8 +2144,7 @@ void WCMD_setshow_date (void) {
WCMD_output
(
WCMD_LoadMessage
(
WCMD_CURRENTDATE
),
curdate
);
WCMD_output
(
WCMD_LoadMessage
(
WCMD_CURRENTDATE
),
curdate
);
if
(
strstrW
(
quals
,
parmT
)
==
NULL
)
{
if
(
strstrW
(
quals
,
parmT
)
==
NULL
)
{
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NEWDATE
));
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NEWDATE
));
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
&
count
);
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
if
(
count
>
2
)
{
if
(
count
>
2
)
{
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NYI
));
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NYI
));
}
}
...
@@ -2265,8 +2262,7 @@ void WCMD_setshow_env (WCHAR *s) {
...
@@ -2265,8 +2262,7 @@ void WCMD_setshow_env (WCHAR *s) {
if
(
strlenW
(
p
)
!=
0
)
WCMD_output
(
p
);
if
(
strlenW
(
p
)
!=
0
)
WCMD_output
(
p
);
/* Read the reply */
/* Read the reply */
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
);
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
if
(
count
>
1
)
{
if
(
count
>
1
)
{
string
[
count
-
1
]
=
'\0'
;
/* ReadFile output is not null-terminated! */
string
[
count
-
1
]
=
'\0'
;
/* ReadFile output is not null-terminated! */
if
(
string
[
count
-
2
]
==
'\r'
)
string
[
count
-
2
]
=
'\0'
;
/* Under Windoze we get CRLF! */
if
(
string
[
count
-
2
]
==
'\r'
)
string
[
count
-
2
]
=
'\0'
;
/* Under Windoze we get CRLF! */
...
@@ -2376,8 +2372,7 @@ void WCMD_setshow_time (void) {
...
@@ -2376,8 +2372,7 @@ void WCMD_setshow_time (void) {
WCMD_output
(
WCMD_LoadMessage
(
WCMD_CURRENTTIME
),
curtime
);
WCMD_output
(
WCMD_LoadMessage
(
WCMD_CURRENTTIME
),
curtime
);
if
(
strstrW
(
quals
,
parmT
)
==
NULL
)
{
if
(
strstrW
(
quals
,
parmT
)
==
NULL
)
{
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NEWTIME
));
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NEWTIME
));
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
buffer
,
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
&
count
);
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
if
(
count
>
2
)
{
if
(
count
>
2
)
{
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NYI
));
WCMD_output
(
WCMD_LoadMessage
(
WCMD_NYI
));
}
}
...
@@ -2474,7 +2469,7 @@ void WCMD_type (WCHAR *command) {
...
@@ -2474,7 +2469,7 @@ void WCMD_type (WCHAR *command) {
static
const
WCHAR
fmt
[]
=
{
'\n'
,
'%'
,
's'
,
'\n'
,
'\n'
,
'\0'
};
static
const
WCHAR
fmt
[]
=
{
'\n'
,
'%'
,
's'
,
'\n'
,
'\n'
,
'\0'
};
WCMD_output
(
fmt
,
thisArg
);
WCMD_output
(
fmt
,
thisArg
);
}
}
while
(
WCMD_ReadFile
(
h
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
)
-
1
,
&
count
,
NULL
))
{
while
(
WCMD_ReadFile
(
h
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
)
-
1
,
&
count
))
{
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
buffer
[
count
]
=
0
;
buffer
[
count
]
=
0
;
WCMD_output_asis
(
buffer
);
WCMD_output_asis
(
buffer
);
...
@@ -2528,7 +2523,7 @@ void WCMD_more (WCHAR *command) {
...
@@ -2528,7 +2523,7 @@ void WCMD_more (WCHAR *command) {
wsprintfW
(
moreStrPage
,
moreFmt
,
moreStr
);
wsprintfW
(
moreStrPage
,
moreFmt
,
moreStr
);
WCMD_enter_paged_mode
(
moreStrPage
);
WCMD_enter_paged_mode
(
moreStrPage
);
while
(
WCMD_ReadFile
(
hstdin
,
buffer
,
(
sizeof
(
buffer
)
/
sizeof
(
WCHAR
))
-
1
,
&
count
,
NULL
))
{
while
(
WCMD_ReadFile
(
hstdin
,
buffer
,
(
sizeof
(
buffer
)
/
sizeof
(
WCHAR
))
-
1
,
&
count
))
{
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
buffer
[
count
]
=
0
;
buffer
[
count
]
=
0
;
WCMD_output_asis
(
buffer
);
WCMD_output_asis
(
buffer
);
...
@@ -2559,8 +2554,7 @@ void WCMD_more (WCHAR *command) {
...
@@ -2559,8 +2554,7 @@ void WCMD_more (WCHAR *command) {
wsprintfW
(
moreStrPage
,
moreFmt2
,
moreStr
,
100
);
wsprintfW
(
moreStrPage
,
moreFmt2
,
moreStr
,
100
);
WCMD_leave_paged_mode
();
WCMD_leave_paged_mode
();
WCMD_output_asis
(
moreStrPage
);
WCMD_output_asis
(
moreStrPage
);
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
buffer
,
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
&
count
);
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
WCMD_enter_paged_mode
(
moreStrPage
);
WCMD_enter_paged_mode
(
moreStrPage
);
}
}
...
@@ -2582,7 +2576,7 @@ void WCMD_more (WCHAR *command) {
...
@@ -2582,7 +2576,7 @@ void WCMD_more (WCHAR *command) {
fileLen
=
(((
ULONG64
)
fileInfo
.
nFileSizeHigh
)
<<
32
)
+
fileInfo
.
nFileSizeLow
;
fileLen
=
(((
ULONG64
)
fileInfo
.
nFileSizeHigh
)
<<
32
)
+
fileInfo
.
nFileSizeLow
;
needsPause
=
TRUE
;
needsPause
=
TRUE
;
while
(
WCMD_ReadFile
(
h
,
buffer
,
(
sizeof
(
buffer
)
/
sizeof
(
WCHAR
))
-
1
,
&
count
,
NULL
))
{
while
(
WCMD_ReadFile
(
h
,
buffer
,
(
sizeof
(
buffer
)
/
sizeof
(
WCHAR
))
-
1
,
&
count
))
{
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
buffer
[
count
]
=
0
;
buffer
[
count
]
=
0
;
curPos
+=
count
;
curPos
+=
count
;
...
@@ -2683,8 +2677,7 @@ int WCMD_volume(BOOL set_label, const WCHAR *path)
...
@@ -2683,8 +2677,7 @@ int WCMD_volume(BOOL set_label, const WCHAR *path)
curdir
[
0
],
label
,
HIWORD
(
serial
),
LOWORD
(
serial
));
curdir
[
0
],
label
,
HIWORD
(
serial
),
LOWORD
(
serial
));
if
(
set_label
)
{
if
(
set_label
)
{
WCMD_output
(
WCMD_LoadMessage
(
WCMD_VOLUMEPROMPT
));
WCMD_output
(
WCMD_LoadMessage
(
WCMD_VOLUMEPROMPT
));
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
);
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
if
(
count
>
1
)
{
if
(
count
>
1
)
{
string
[
count
-
1
]
=
'\0'
;
/* ReadFile output is not null-terminated! */
string
[
count
-
1
]
=
'\0'
;
/* ReadFile output is not null-terminated! */
if
(
string
[
count
-
2
]
==
'\r'
)
string
[
count
-
2
]
=
'\0'
;
/* Under Windoze we get CRLF! */
if
(
string
[
count
-
2
]
==
'\r'
)
string
[
count
-
2
]
=
'\0'
;
/* Under Windoze we get CRLF! */
...
...
programs/cmd/wcmd.h
View file @
29b57ca8
...
@@ -108,8 +108,7 @@ void WCMD_opt_s_strip_quotes(WCHAR *cmd);
...
@@ -108,8 +108,7 @@ void WCMD_opt_s_strip_quotes(WCHAR *cmd);
WCHAR
*
WCMD_LoadMessage
(
UINT
id
);
WCHAR
*
WCMD_LoadMessage
(
UINT
id
);
WCHAR
*
WCMD_strdupW
(
const
WCHAR
*
input
);
WCHAR
*
WCMD_strdupW
(
const
WCHAR
*
input
);
void
WCMD_strsubstW
(
WCHAR
*
start
,
const
WCHAR
*
next
,
const
WCHAR
*
insert
,
int
len
);
void
WCMD_strsubstW
(
WCHAR
*
start
,
const
WCHAR
*
next
,
const
WCHAR
*
insert
,
int
len
);
BOOL
WCMD_ReadFile
(
const
HANDLE
hIn
,
WCHAR
*
intoBuf
,
const
DWORD
maxChars
,
BOOL
WCMD_ReadFile
(
const
HANDLE
hIn
,
WCHAR
*
intoBuf
,
const
DWORD
maxChars
,
LPDWORD
charsRead
);
LPDWORD
charsRead
,
const
LPOVERLAPPED
unused
);
WCHAR
*
WCMD_ReadAndParseLine
(
const
WCHAR
*
initialcmd
,
CMD_LIST
**
output
,
WCHAR
*
WCMD_ReadAndParseLine
(
const
WCHAR
*
initialcmd
,
CMD_LIST
**
output
,
HANDLE
readFrom
,
const
BOOL
is_console_handle
);
HANDLE
readFrom
,
const
BOOL
is_console_handle
);
...
...
programs/cmd/wcmdmain.c
View file @
29b57ca8
...
@@ -237,11 +237,9 @@ void WCMD_leave_paged_mode(void)
...
@@ -237,11 +237,9 @@ void WCMD_leave_paged_mode(void)
* WCMD_Readfile
* WCMD_Readfile
*
*
* Read characters in from a console/file, returning result in Unicode
* Read characters in from a console/file, returning result in Unicode
* with signature identical to ReadFile
*/
*/
BOOL
WCMD_ReadFile
(
const
HANDLE
hIn
,
WCHAR
*
intoBuf
,
const
DWORD
maxChars
,
BOOL
WCMD_ReadFile
(
const
HANDLE
hIn
,
WCHAR
*
intoBuf
,
const
DWORD
maxChars
,
LPDWORD
charsRead
)
LPDWORD
charsRead
,
const
LPOVERLAPPED
unused
)
{
{
BOOL
res
;
BOOL
res
;
/* Try to read from console as Unicode */
/* Try to read from console as Unicode */
...
@@ -258,7 +256,7 @@ BOOL WCMD_ReadFile(const HANDLE hIn, WCHAR *intoBuf, const DWORD maxChars,
...
@@ -258,7 +256,7 @@ BOOL WCMD_ReadFile(const HANDLE hIn, WCHAR *intoBuf, const DWORD maxChars,
return
FALSE
;
return
FALSE
;
/* Read from file (assume OEM codepage) */
/* Read from file (assume OEM codepage) */
res
=
ReadFile
(
hIn
,
buffer
,
maxChars
,
&
numRead
,
unused
);
res
=
ReadFile
(
hIn
,
buffer
,
maxChars
,
&
numRead
,
NULL
);
/* Convert from OEM */
/* Convert from OEM */
*
charsRead
=
MultiByteToWideChar
(
GetConsoleCP
(),
0
,
buffer
,
numRead
,
*
charsRead
=
MultiByteToWideChar
(
GetConsoleCP
(),
0
,
buffer
,
numRead
,
...
@@ -293,8 +291,7 @@ static void WCMD_output_asis_handle (DWORD std_handle, const WCHAR *message) {
...
@@ -293,8 +291,7 @@ static void WCMD_output_asis_handle (DWORD std_handle, const WCHAR *message) {
if
(
++
line_count
>=
max_height
-
1
)
{
if
(
++
line_count
>=
max_height
-
1
)
{
line_count
=
0
;
line_count
=
0
;
WCMD_output_asis_len
(
pagedMessage
,
strlenW
(
pagedMessage
),
handle
);
WCMD_output_asis_len
(
pagedMessage
,
strlenW
(
pagedMessage
),
handle
);
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
);
sizeof
(
string
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
}
}
}
}
}
while
(((
message
=
ptr
)
!=
NULL
)
&&
(
*
ptr
));
}
while
(((
message
=
ptr
)
!=
NULL
)
&&
(
*
ptr
));
...
...
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