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
926da13e
Commit
926da13e
authored
Jun 03, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Jun 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Move writing to console into a single function.
parent
5cc492c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
wcmdmain.c
programs/cmd/wcmdmain.c
+17
-8
No files found.
programs/cmd/wcmdmain.c
View file @
926da13e
...
...
@@ -1193,6 +1193,16 @@ int p = 0;
}
/*******************************************************************
* WCMD_output_asis_len - send output to current standard output
* device without formatting eg. when message contains '%'
* of a supplied length.
*/
static
void
WCMD_output_asis_len
(
const
char
*
message
,
int
len
)
{
DWORD
count
;
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
message
,
len
,
&
count
,
NULL
);
}
/*******************************************************************
* WCMD_output - send output to current standard output device.
*
*/
...
...
@@ -1208,9 +1218,10 @@ void WCMD_output (const char *format, ...) {
va_end
(
ap
);
if
(
ret
>=
sizeof
(
string
))
{
WINE_ERR
(
"Output truncated in WCMD_output
\n
"
);
string
[
sizeof
(
string
)
-
1
]
=
'\0'
;
ret
=
sizeof
(
string
)
-
1
;
string
[
ret
]
=
'\0'
;
}
WCMD_output_asis
(
string
);
WCMD_output_asis
_len
(
string
,
ret
);
}
...
...
@@ -1250,22 +1261,20 @@ void WCMD_output_asis (const char *message) {
if
(
paged_mode
)
{
do
{
if
((
ptr
=
strchr
(
message
,
'\n'
))
!=
NULL
)
ptr
++
;
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
message
,
(
ptr
)
?
ptr
-
message
:
lstrlen
(
message
),
&
count
,
NULL
);
WCMD_output_asis_len
(
message
,
(
ptr
)
?
ptr
-
message
:
lstrlen
(
message
));
if
(
ptr
)
{
if
(
++
line_count
>=
max_height
-
1
)
{
line_count
=
0
;
WCMD_output_asis
(
pagedMessage
);
line_count
=
1
;
WCMD_output_asis
_len
(
pagedMessage
,
lstrlen
(
pagedMessage
)
);
ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
sizeof
(
string
),
&
count
,
NULL
);
}
}
}
while
((
message
=
ptr
)
!=
NULL
);
}
else
{
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
message
,
lstrlen
(
message
),
&
count
,
NULL
);
WCMD_output_asis_len
(
message
,
lstrlen
(
message
)
);
}
}
/***************************************************************************
* WCMD_strtrim_leading_spaces
*
...
...
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