cmd: an issue with cd .. command

Nowres Rafid nowres.rafed at gmail.com
Thu Aug 11 08:56:30 CDT 2011


I corrected the code as suggested
and added some test cases

On Thu, 2011-08-11 at 14:03 +0200, Frédéric Delanoy wrote:

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110811/7c709823/attachment.htm>


More information about the wine-devel mailing list