cmd: Add a space at the end of the first echo'ed batch line

Jacek Caban jacek at codeweavers.com
Sun Oct 3 08:37:17 CDT 2010


  On 10/3/10 1:18 PM, Alexandre Goujon wrote:
> ---
>   programs/cmd/tests/batch.c |    2 +-
>   programs/cmd/wcmdmain.c    |    3 +++
>   2 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c
> index cc8c020..d7a5e84 100644
> --- a/programs/cmd/tests/batch.c
> +++ b/programs/cmd/tests/batch.c
> @@ -131,7 +131,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const
>               }else if(exp_ptr+sizeof(todo_space_cmd)<= exp_end
>                       &&  !memcmp(exp_ptr, todo_space_cmd, sizeof(todo_space_cmd))) {
>                   exp_ptr += sizeof(todo_space_cmd);
> -                todo_wine ok(*out_ptr == ' ', "expected space\n");
> +                ok(*out_ptr == ' ', "expected space\n");

@todo_space@ is meant to do tests in todo_wine block. You should change 
@todo_space@ to spec in .exp file instead. If we're convinced that the 
whole keyword is not useful anymore, the whole handling code should be 
removed (although I think we'd better keep it).

>                   if(out_ptr<  out_end&&  *out_ptr == ' ')
>                       out_ptr++;
>                   continue;
> diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
> index b50512e..247457a 100644
> --- a/programs/cmd/wcmdmain.c
> +++ b/programs/cmd/wcmdmain.c
> @@ -1779,8 +1779,11 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF
>       if (context) handleExpansion(extraSpace, FALSE, NULL, NULL);
>       /* Show prompt before batch line IF echo is on and in batch program */
>       if (context&&  echo_mode&&  extraSpace[0]&&  (extraSpace[0] != '@')) {
> +      const WCHAR spc[] = {' ','\0'};
>         WCMD_show_prompt();
>         WCMD_output_asis(extraSpace);
> +      /* I don't know why Windows puts a space here but it does */
> +      WCMD_output_asis(spc);

More tests would be nice.

Jacek



More information about the wine-devel mailing list