cmd: Output error messages to stderr instead of stdout where appropriate.

oldstable
Frédéric Delanoy 2011-10-01 04:15:05 +02:00 committed by Alexandre Julliard
parent 40c783fcc1
commit aee397a317
2 changed files with 6 additions and 6 deletions

View File

@ -1124,7 +1124,7 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
/* Process the input file */
if (input == INVALID_HANDLE_VALUE) {
WCMD_print_error ();
WCMD_output (WCMD_LoadMessage(WCMD_READFAIL), item);
WCMD_output_stderr(WCMD_LoadMessage(WCMD_READFAIL), item);
errorlevel = 1;
return; /* FOR loop aborts at first failure here */
@ -1539,7 +1539,7 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
WCMD_parameter(s, 1, &command, NULL);
}
else {
WCMD_output (WCMD_LoadMessage(WCMD_SYNTAXERR));
WCMD_output_stderr(WCMD_LoadMessage(WCMD_SYNTAXERR));
return;
}

View File

@ -1055,7 +1055,7 @@ void WCMD_run_program (WCHAR *command, int called) {
if (strchrW(param1, '.') != NULL) extensionsupplied = TRUE;
if (strlenW(param1) >= MAX_PATH)
{
WCMD_output_asis(WCMD_LoadMessage(WCMD_LINETOOLONG));
WCMD_output_asis_stderr(WCMD_LoadMessage(WCMD_LINETOOLONG));
return;
}
@ -1836,9 +1836,9 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output,
/* Handle truncated input - issue warning */
if (strlenW(extraSpace) == MAXSTRING -1) {
WCMD_output_asis(WCMD_LoadMessage(WCMD_TRUNCATEDLINE));
WCMD_output_asis(extraSpace);
WCMD_output_asis(newline);
WCMD_output_asis_stderr(WCMD_LoadMessage(WCMD_TRUNCATEDLINE));
WCMD_output_asis_stderr(extraSpace);
WCMD_output_asis_stderr(newline);
}
/* Replace env vars if in a batch context */