Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- programs/cmd/tests/interactive_builtins.cmd | 9 ++++++++- programs/cmd/tests/interactive_builtins.cmd.exp | 18 +++++++++++++++++- programs/cmd/wcmdmain.c | 7 +++++++ 3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/tests/interactive_builtins.cmd b/programs/cmd/tests/interactive_builtins.cmd index 546bad4eda5..d1e308f159a 100644 --- a/programs/cmd/tests/interactive_builtins.cmd +++ b/programs/cmd/tests/interactive_builtins.cmd @@ -1 +1,8 @@ -@exit 0 +@echo --------- testing echo +echo foo +@echo foo +echo off +echo foo +@echo foo +echo --------- done +exit 0 diff --git a/programs/cmd/tests/interactive_builtins.cmd.exp b/programs/cmd/tests/interactive_builtins.cmd.exp index fe6f88e5414..64482e85c04 100644 --- a/programs/cmd/tests/interactive_builtins.cmd.exp +++ b/programs/cmd/tests/interactive_builtins.cmd.exp @@ -1 +1,17 @@ -@pwd@>@exit 0 +@pwd@>@echo --------- testing echo +--------- testing echo + +@pwd@>echo foo +foo + +@pwd@>@echo foo +foo + +@pwd@>echo off +echo foo +foo +@echo foo +foo +echo --------- done +--------- done +exit 0 diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 4510b5e309f..ee863856ec9 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1897,6 +1897,13 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE WCMD_output_asis(L"\r\n"); }
+ /* echo input stream if naturally not echoed */ + if (!context && !optionalcmd && GetFileType(readFrom) != FILE_TYPE_CHAR) + { + WCMD_output_asis(curPos); + WCMD_output_asis(L"\r\n"); + /* FIXME: same quirk as above for trailing space? */ + } /* Skip repeated 'no echo' characters */ while (*curPos == '@') curPos++;