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
fbddecab
Commit
fbddecab
authored
Sep 24, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Sep 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Add WCMD_output_stderr function to output error messages to stderr.
parent
e5565a6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
wcmd.h
programs/cmd/wcmd.h
+1
-0
wcmdmain.c
programs/cmd/wcmdmain.c
+22
-1
No files found.
programs/cmd/wcmd.h
View file @
fbddecab
...
...
@@ -73,6 +73,7 @@ void WCMD_leave_paged_mode(void);
void
WCMD_more
(
WCHAR
*
);
void
WCMD_move
(
void
);
void
WCMD_output
(
const
WCHAR
*
format
,
...);
void
WCMD_output_stderr
(
const
WCHAR
*
format
,
...);
void
WCMD_output_asis
(
const
WCHAR
*
message
);
void
WCMD_output_asis_stderr
(
const
WCHAR
*
message
);
void
WCMD_pause
(
void
);
...
...
programs/cmd/wcmdmain.c
View file @
fbddecab
...
...
@@ -174,7 +174,7 @@ void WCMD_output (const WCHAR *format, ...) {
va_start
(
ap
,
format
);
ret
=
vsnprintfW
(
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
),
format
,
ap
);
if
(
ret
>=
(
sizeof
(
string
)
/
sizeof
(
WCHAR
)))
{
WINE_ERR
(
"Output truncated
in WCMD_output
\n
"
);
WINE_ERR
(
"Output truncated
\n
"
);
ret
=
(
sizeof
(
string
)
/
sizeof
(
WCHAR
))
-
1
;
string
[
ret
]
=
'\0'
;
}
...
...
@@ -182,6 +182,27 @@ void WCMD_output (const WCHAR *format, ...) {
WCMD_output_asis_len
(
string
,
ret
,
GetStdHandle
(
STD_OUTPUT_HANDLE
));
}
/*******************************************************************
* WCMD_output_stderr - send output to current standard error device.
*
*/
void
WCMD_output_stderr
(
const
WCHAR
*
format
,
...)
{
va_list
ap
;
WCHAR
string
[
1024
];
int
ret
;
va_start
(
ap
,
format
);
ret
=
vsnprintfW
(
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
),
format
,
ap
);
if
(
ret
>=
(
sizeof
(
string
)
/
sizeof
(
WCHAR
)))
{
WINE_ERR
(
"Output truncated
\n
"
);
ret
=
(
sizeof
(
string
)
/
sizeof
(
WCHAR
))
-
1
;
string
[
ret
]
=
'\0'
;
}
va_end
(
ap
);
WCMD_output_asis_len
(
string
,
ret
,
GetStdHandle
(
STD_ERROR_HANDLE
));
}
static
int
line_count
;
static
int
max_height
;
...
...
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