cmd: Add WCMD_output_stderr function to output error messages to stderr.
This commit is contained in:
parent
e5565a6d64
commit
fbddecab77
@ -73,6 +73,7 @@ void WCMD_leave_paged_mode(void);
|
|||||||
void WCMD_more (WCHAR *);
|
void WCMD_more (WCHAR *);
|
||||||
void WCMD_move (void);
|
void WCMD_move (void);
|
||||||
void WCMD_output (const WCHAR *format, ...);
|
void WCMD_output (const WCHAR *format, ...);
|
||||||
|
void WCMD_output_stderr (const WCHAR *format, ...);
|
||||||
void WCMD_output_asis (const WCHAR *message);
|
void WCMD_output_asis (const WCHAR *message);
|
||||||
void WCMD_output_asis_stderr (const WCHAR *message);
|
void WCMD_output_asis_stderr (const WCHAR *message);
|
||||||
void WCMD_pause (void);
|
void WCMD_pause (void);
|
||||||
|
@ -174,7 +174,7 @@ void WCMD_output (const WCHAR *format, ...) {
|
|||||||
va_start(ap,format);
|
va_start(ap,format);
|
||||||
ret = vsnprintfW(string, sizeof(string)/sizeof(WCHAR), format, ap);
|
ret = vsnprintfW(string, sizeof(string)/sizeof(WCHAR), format, ap);
|
||||||
if( ret >= (sizeof(string)/sizeof(WCHAR))) {
|
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;
|
ret = (sizeof(string)/sizeof(WCHAR)) - 1;
|
||||||
string[ret] = '\0';
|
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_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 line_count;
|
||||||
static int max_height;
|
static int max_height;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user