<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
I corrected the code as suggested<BR>
and added some test cases<BR>
<BR>
On Thu, 2011-08-11 at 14:03 +0200, Fr&#233;d&#233;ric Delanoy wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On Thu, Aug 11, 2011 at 05:19, Nowres Rafid &lt;<A HREF="mailto:nowres.rafed@gmail.com">nowres.rafed@gmail.com</A>&gt; wrote:
&gt; Hello,
&gt;
&gt; the command &quot;cd ..&nbsp;&nbsp; &quot; doesn't work when there is extra spaces at the end.
&gt;
&gt; I propose this patch and ask for your confirmation about it.
&gt;
&gt; best regards.

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

You shouldn't modify the &quot;command&quot; parameter. This one ought to be
constant, even if it's not currently marked so.
It's better to change the &quot;string&quot; 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 &quot;[1/1]&quot;... use git
format-patch &quot;-k&quot; option, or edit the subject before submission.

Fr&#233;d&#233;ric
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>