Jason Edmeades : cmd: echo.word should echo back the word without the .

Alexandre Julliard julliard at winehq.org
Wed Sep 8 13:32:13 CDT 2010


Module: wine
Branch: master
Commit: 32c8b46633f0fe5d31d68573ed23f3bf761a8c6f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=32c8b46633f0fe5d31d68573ed23f3bf761a8c6f

Author: Jason Edmeades <jason.edmeades at googlemail.com>
Date:   Tue Sep  7 15:59:43 2010 -0700

cmd: echo.word should echo back the word without the .

---

 programs/cmd/builtins.c                  |    9 +++------
 programs/cmd/tests/test_builtins.cmd     |    2 ++
 programs/cmd/tests/test_builtins.cmd.exp |    2 ++
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 7a4f9a1..5ccbb8f 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 d596c18..d9f5cf7 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 306953b..8942cb3 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




More information about the wine-cvs mailing list