cmd: an issue with cd .. command

Frédéric Delanoy frederic.delanoy at gmail.com
Thu Aug 11 07:03:48 CDT 2011


On Thu, Aug 11, 2011 at 05:19, Nowres Rafid <nowres.rafed at gmail.com> wrote:
> Hello,
>
> the command "cd ..   " doesn't work when there is extra spaces at the end.
>
> I propose this patch and ask for your confirmation about it.
>
> best regards.

   }
   else {
+
+    /* Remove any space at the end of command
+        This was because "cd .. " wasn't working */
+      {
+        WCHAR *ptr = command + strlenW(command) - 1;
+
+        while(*ptr == ' ')
+            *ptr-- = 0;
+      }

You shouldn't modify the "command" parameter. This one ought to be
constant, even if it's not currently marked so.
It's better to change the "string" string.

Also you should add testcases to cmd's test suite, possibly as a
preliminary patch of a series, but it can also be together with the
patch. That's up to you.

Also for single patches, you don't need "[1/1]"... use git
format-patch "-k" option, or edit the subject before submission.

Frédéric



More information about the wine-devel mailing list