diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 7a4f9a1d3cb..5ccbb8fecdd 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -668,15 +668,12 @@ BOOL WCMD_delete (WCHAR *command, BOOL expectDir) { void WCMD_echo (const WCHAR *command) { int count; + const WCHAR *origcommand = command; - if ((command[0] == '.') && (command[1] == 0)) { - WCMD_output (newline); - return; - } - if (command[0]==' ') + if (command[0]==' ' || command[0]=='.') command++; count = strlenW(command); - if (count == 0) { + if (count == 0 && origcommand[0]!='.') { if (echo_mode) WCMD_output (WCMD_LoadMessage(WCMD_ECHOPROMPT), onW); else WCMD_output (WCMD_LoadMessage(WCMD_ECHOPROMPT), offW); return; diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index d596c18eec9..d9f5cf76ab1 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -9,6 +9,8 @@ echo "doublequotedword" echo "/?" echo. echo . +echo.word +echo .word echo ------------ Testing 'set' -------------- echo set "FOO=bar" should not include the quotes in the variable value diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 306953b28f7..8942cb36351 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -9,6 +9,8 @@ at-echoed-word "/?" . +word +.word ------------ Testing 'set' -------------- set "FOO=bar" should not include the quotes in the variable value bar