[Bug 27778] TYPE outputs extraneous blank line after file contents

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Jul 13 16:56:38 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=27778

--- Comment #2 from Frédéric Delanoy <frederic.delanoy at gmail.com> 2011-07-13 16:56:38 CDT ---
(In reply to comment #1)
> maybe just
> 
> diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
> index 0352e59..f7411e2 100644
> --- a/programs/cmd/builtins.c
> +++ b/programs/cmd/builtins.c
> @@ -2523,7 +2523,7 @@ void WCMD_type (WCHAR *command) {
>        errorlevel = 1;
>      } else {
>        if (writeHeaders) {
> -        static const WCHAR fmt[] = {'\n','%','s','\n','\n','\0'};
> +        static const WCHAR fmt[] = {'\n','%','s','\n','\0'};
>          WCMD_output(fmt, thisArg);
>        }

Good try. Actually this was my first idea as well, doesn't work.
In fact, it's used in (undocumented) TYPE multiple files mode (4ef2f8ba) where
you use "TYPE foo bar".
Now the "writeHeaders" name is a bit misleading... it should probably have been
called "multipleFilesMode" or similar.

Think I found the problem: windows adds a newline when echo mode is on (and
*not* when it's off).
http://source.winehq.org/git/wine.git/commitdiff/78f38a742fb48a723392687615669f7f5f5b74d1
added implementation when echo mode is on.
However, it also erroneously adds a newline when it's off, as is the case e.g.
in test_builtins.cmd. I "simply" need to add the condition that the mode is
"echo on" for the extra newline to be added.

(BTW "echo off" mode doesn't work in interactive mode... I'll probably add a
bug for this if necessary)

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list