Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46983
Signed-off-by: Bernhard Übelacker bernhardu@mailbox.org --- programs/cmd/builtins.c | 4 ++-- programs/cmd/tests/test_builtins.cmd | 10 +++++++++- programs/cmd/tests/test_builtins.cmd.exp | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 62ae19a494..cd5f744a27 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -4561,8 +4561,8 @@ void WCMD_type (WCHAR *args) { errorlevel = 1; } else { if (writeHeaders) { - static const WCHAR fmt[] = {'\n','%','1','\n','\n','\0'}; - WCMD_output(fmt, thisArg); + static const WCHAR fmt[] = {'\n','%','1','\n','\n','\n','\0'}; + WCMD_output_stderr(fmt, thisArg); } while (WCMD_ReadFile(h, buffer, ARRAY_SIZE(buffer) - 1, &count)) { if (count == 0) break; /* ReadFile reports success on EOF! */ diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index f4dfc9f26d..a992cda480 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -875,7 +875,15 @@ type ."\foobaz" echo ---2 type ".\foobaz" echo ---3 -del foobaz +echo foo> foobay +echo ---4 +type foobaz foobay > foobax 2> foobaw +echo ---5 +type foobax +echo ---6 +type foobaw +echo ---7 +del foobaz foobay foobax foobaw
echo ------------ Testing NUL ------------ md foobar & cd foobar diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index d78d91a6cf..488c8e6fd8 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -659,6 +659,20 @@ bar ---2 bar ---3 +---4 +---5 +bar +foo +---6 + +foobaz + + + +foobay + + +---7 ------------ Testing NUL ------------ bar bar