WCMD: fix echo.

Mike McCormack mike at codeweavers.com
Wed Mar 17 20:21:05 CST 2004


"echo." should echo a blank line.
"echo ." should echo a single period.
"echo  ." should echo a space and a period

Mike


ChangeLog:
* fix wcmd's handling of "echo."
-------------- next part --------------
? programs/wcmd/wcmd.exe.spec.c
Index: programs/wcmd/builtins.c
===================================================================
RCS file: /home/wine/wine/programs/wcmd/builtins.c,v
retrieving revision 1.21
diff -u -r1.21 builtins.c
--- programs/wcmd/builtins.c	30 Dec 2003 19:17:31 -0000	1.21
+++ programs/wcmd/builtins.c	18 Mar 2004 01:33:24 -0000
@@ -212,14 +212,16 @@
 static const char *eon = "Echo is ON\n", *eoff = "Echo is OFF\n";
 int count;
 
+  if ((command[0] == '.') && (command[1] == 0)) {
+    WCMD_output (newline);
+    return;
+  }
+  if (command[0]==' ')
+    command++;
   count = strlen(command);
   if (count == 0) {
     if (echo_mode) WCMD_output (eon);
     else WCMD_output (eoff);
-    return;
-  }
-  if ((count == 1) && (command[0] == '.')) {
-    WCMD_output (newline);
     return;
   }
   if (lstrcmpi(command, "ON") == 0) {
Index: programs/wcmd/wcmdmain.c
===================================================================
RCS file: /home/wine/wine/programs/wcmd/wcmdmain.c,v
retrieving revision 1.39
diff -u -r1.39 wcmdmain.c
--- programs/wcmd/wcmdmain.c	6 Jan 2004 22:08:33 -0000	1.39
+++ programs/wcmd/wcmdmain.c	18 Mar 2004 01:33:24 -0000
@@ -384,12 +384,7 @@
         WCMD_directory ();
         break;
       case WCMD_ECHO:
-        /* Use the unstripped version of the following data - step over the space */
-        /* but only if a parameter follows                                        */
-        if (strlen(&whichcmd[count]) > 0)
-          WCMD_echo(&whichcmd[count+1]);
-        else
-          WCMD_echo(&whichcmd[count]);
+        WCMD_echo(&whichcmd[count]);
         break;
       case WCMD_FOR:
         WCMD_for (p);


More information about the wine-patches mailing list